cbd_runtime.mvc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import models/SimpleClassDiagrams as SCD
  2. include "primitives.alh"
  3. SCD CausalBlockDiagrams_Runtime{
  4. Class Float {
  5. $
  6. if (bool_not(is_physical_float(self))):
  7. return "Float has no float value"!
  8. else:
  9. return "OK"!
  10. $
  11. }
  12. Class Block{}
  13. Class ConstantBlock{
  14. value : Float {
  15. target_lower_cardinality = 1
  16. target_upper_cardinality = 1
  17. }
  18. }
  19. Class AdditionBlock{}
  20. Class NegatorBlock{}
  21. Class MultiplyBlock{}
  22. Class InverseBlock{}
  23. Class DelayBlock{
  24. memory : Float {
  25. target_lower_cardinality = 1
  26. target_upper_cardinality = 1
  27. }
  28. }
  29. Class Pointers {
  30. lower_cardinality = 1
  31. upper_multiplicit = 1
  32. }
  33. Class Schedule {
  34. block : Block {
  35. target_lower_cardinality = 0
  36. target_upper_cardinality = 1
  37. }
  38. next : Schedule {
  39. target_lower_cardinality = 1
  40. target_upper_cardinality = 1
  41. }
  42. lower_cardinality = 1
  43. }
  44. Association ActiveSchedule(Pointers, Schedule) {
  45. target_lower_cardinality = 1
  46. target_upper_cardinality = 1
  47. }
  48. Association Link(Block, Block){
  49. signal : Float {
  50. target_lower_cardinality = 0
  51. target_upper_cardinality = 1
  52. }
  53. }
  54. Association InitialCondition(Block, DelayBlock){
  55. source_lower_cardinality = 0
  56. source_upper_cardinality = 1
  57. }
  58. Inheritance (ConstantBlock, Block){}
  59. Inheritance (AdditionBlock, Block){}
  60. Inheritance (NegatorBlock, Block){}
  61. Inheritance (MultiplyBlock, Block){}
  62. Inheritance (InverseBlock, Block){}
  63. Inheritance (DelayBlock, Block){}
  64. }
  65. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime