소스 검색

Added CBD design and runtime models

Yentl Van Tendeloo 7 년 전
부모
커밋
57805071f1
2개의 변경된 파일161개의 추가작업 그리고 0개의 파일을 삭제
  1. 62 0
      models/cbd_design.mvc
  2. 99 0
      models/cbd_runtime.mvc

+ 62 - 0
models/cbd_design.mvc

@@ -0,0 +1,62 @@
+include "primitives.alh"
+
+Class Float {
+    constraint =  $
+        String function constraint(self : Element):
+            if (bool_not(is_physical_float(self))):
+                return "Float has no float value"!
+            else:
+                return "OK"!
+    $
+}
+
+Class String {
+    constraint = $
+        String function constraint(self : Element):
+            if (bool_not(is_physical_string(self))):
+                return "String has no string value"!
+            else:
+                return "OK"!
+    $
+}
+
+Class Block{}
+Class ICBlock{}
+
+Class ConstantBlock{
+    value : Float {
+        target_lower_cardinality = 1
+        target_upper_cardinality = 1
+    }
+}
+
+Class AdditionBlock{}
+Class NegatorBlock{}
+Class MultiplyBlock{}
+Class InverseBlock{}
+Class DelayBlock{}
+Class IntegratorBlock{}
+Class DerivatorBlock{}
+Class ProbeBlock{
+    name : String {
+        target_lower_cardinality = 1
+        target_upper_cardinality = 1
+    }
+}
+
+Association Link(Block, Block){}
+Association InitialCondition(Block, ICBlock){
+    source_lower_cardinality = 1
+    source_upper_cardinality = 1
+}
+
+Inheritance (ConstantBlock, Block){}
+Inheritance (AdditionBlock, Block){}
+Inheritance (NegatorBlock, Block){}
+Inheritance (MultiplyBlock, Block){}
+Inheritance (InverseBlock, Block){}
+Inheritance (ProbeBlock, Block){}
+Inheritance (ICBlock, Block){}
+Inheritance (DelayBlock, ICBlock){}
+Inheritance (IntegratorBlock, ICBlock){}
+Inheritance (DerivatorBlock, ICBlock){}

+ 99 - 0
models/cbd_runtime.mvc

@@ -0,0 +1,99 @@
+import models/SimpleClassDiagrams as SCD
+include "primitives.alh"
+
+SCD CausalBlockDiagrams_Runtime{
+    Class Float {
+        constraint = $
+            String function constraint(self : Element):
+                if (bool_not(is_physical_float(self))):
+                    return "Float has no float value"!
+                else:
+                    return "OK"!
+        $
+    }
+
+    Class String {
+        $
+            String function constraint(self : Element):
+                if (bool_not(is_physical_string(self))):
+                    return "String has no string value"!
+                else:
+                    return "OK"!
+        $
+    }
+
+    Class Block{
+        signal : Float {
+            target_lower_cardinality = 1
+            target_upper_cardinality = 1
+        }
+    }
+    Class ICBlock{
+        last_in : Float {
+            target_lower_cardinality = 0
+            target_upper_cardinality = 1
+        }
+    }
+
+    Class ConstantBlock{
+        value : Float {
+            target_lower_cardinality = 1
+            target_upper_cardinality = 1
+        }
+    }
+
+    Class ProbeBlock{
+        name : String {
+            target_lower_cardinality = 1
+            target_upper_cardinality = 1
+        }
+    }
+
+    Class AdditionBlock{}
+    Class NegatorBlock{}
+    Class MultiplyBlock{}
+    Class InverseBlock{}
+    Class DelayBlock{}
+    Class IntegratorBlock{
+        last_out : Float {
+            target_lower_cardinality = 0
+            target_upper_cardinality = 1
+        }
+    }
+
+    Class DerivatorBlock{}
+    Class Time{
+        lower_cardinality = 1
+        upper_cardinality = 1
+
+        start_time : Float {
+            target_lower_cardinality = 1
+            target_upper_cardinality = 1
+        }
+
+        current_time : Float {
+            target_lower_cardinality = 1
+            target_upper_cardinality = 1
+        }
+    }
+
+    Association Link(Block, Block){
+    }
+    Association InitialCondition(Block, ICBlock){
+        source_lower_cardinality = 0
+        source_upper_cardinality = 1
+    }
+
+    Inheritance (ConstantBlock, Block){}
+    Inheritance (AdditionBlock, Block){}
+    Inheritance (NegatorBlock, Block){}
+    Inheritance (MultiplyBlock, Block){}
+    Inheritance (InverseBlock, Block){}
+    Inheritance (ICBlock, Block){}
+    Inheritance (DelayBlock, ICBlock){}
+    Inheritance (DerivatorBlock, ICBlock){}
+    Inheritance (IntegratorBlock, ICBlock){}
+    Inheritance (ProbeBlock, Block){}
+}
+
+export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime