123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- import models/SimpleClassDiagrams as SCD
- include "primitives.alh"
- SCD CausalBlockDiagrams_Runtime{
- Class Float {
- $
- if (bool_not(is_physical_float(self))):
- return "Float has no float value"!
- else:
- return "OK"!
- $
- }
- Class Boolean {
- $
- if (bool_not(is_physical_boolean(self))):
- return "Boolean has no bool value"!
- else:
- return "OK"!
- $
- }
- Class Natural {
- $
- if (bool_not(is_physical_int(self))):
- return "Natural has no integer value at " + name!
- elif (integer_lt(self, 0)):
- return "Natural does not have a positive or zero value at " + name!
- else:
- return "OK"!
- $
- }
- Class Block{
- signal : Float {
- target_lower_cardinality = 1
- target_upper_cardinality = 1
- }
- }
- Class ConstantBlock{
- value : Float {
- target_lower_cardinality = 1
- target_upper_cardinality = 1
- }
- }
- Class AdditionBlock{}
- Class NegatorBlock{}
- Class MultiplyBlock{}
- Class InverseBlock{}
- Class DelayBlock{
- memory : Float {
- target_lower_cardinality = 1
- target_upper_cardinality = 1
- }
- }
- Class Time{
- lower_cardinality = 1
- upper_cardinality = 1
- current_time : Natural {
- target_lower_cardinality = 1
- target_upper_cardinality = 1
- }
- termination_time : Natural {
- target_lower_cardinality = 1
- target_upper_cardinality = 1
- }
- }
- Class Schedule {
- lower_cardinality = 1
- }
- Association LinkedBlock(Schedule, Block){
- target_lower_cardinality = 0
- target_upper_cardinality = 1
- }
- Association NextSchedule(Schedule, Schedule){
- target_lower_cardinality = 0
- target_upper_cardinality = 1
- }
- Association Link(Block, Block){
- }
- Association InitialCondition(Block, DelayBlock){
- source_lower_cardinality = 0
- source_upper_cardinality = 1
- }
- Inheritance (ConstantBlock, Block){}
- Inheritance (AdditionBlock, Block){}
- Inheritance (NegatorBlock, Block){}
- Inheritance (MultiplyBlock, Block){}
- Inheritance (InverseBlock, Block){}
- Inheritance (DelayBlock, Block){}
- }
- export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime
|