cbd_runtime.mvc 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 String {
  13. $
  14. if (bool_not(is_physical_string(self))):
  15. return "String has no string value"!
  16. else:
  17. return "OK"!
  18. $
  19. }
  20. Class Block{
  21. signal : Float {
  22. target_lower_cardinality = 1
  23. target_upper_cardinality = 1
  24. }
  25. }
  26. Class ICBlock{
  27. last_in : Float {
  28. target_lower_cardinality = 0
  29. target_upper_cardinality = 1
  30. }
  31. }
  32. Class ConstantBlock{
  33. value : Float {
  34. target_lower_cardinality = 1
  35. target_upper_cardinality = 1
  36. }
  37. }
  38. Class ProbeBlock{
  39. name : String {
  40. target_lower_cardinality = 1
  41. target_upper_cardinality = 1
  42. }
  43. }
  44. Class AdditionBlock{}
  45. Class NegatorBlock{}
  46. Class MultiplyBlock{}
  47. Class InverseBlock{}
  48. Class DelayBlock{}
  49. Class IntegratorBlock{
  50. last_out : Float {
  51. target_lower_cardinality = 0
  52. target_upper_cardinality = 1
  53. }
  54. }
  55. Class DerivatorBlock{}
  56. Class Time{
  57. lower_cardinality = 1
  58. upper_cardinality = 1
  59. start_time : Float {
  60. target_lower_cardinality = 1
  61. target_upper_cardinality = 1
  62. }
  63. current_time : Float {
  64. target_lower_cardinality = 1
  65. target_upper_cardinality = 1
  66. }
  67. }
  68. Association Link(Block, Block){
  69. }
  70. Association InitialCondition(Block, ICBlock){
  71. source_lower_cardinality = 0
  72. source_upper_cardinality = 1
  73. }
  74. Inheritance (ConstantBlock, Block){}
  75. Inheritance (AdditionBlock, Block){}
  76. Inheritance (NegatorBlock, Block){}
  77. Inheritance (MultiplyBlock, Block){}
  78. Inheritance (InverseBlock, Block){}
  79. Inheritance (ICBlock, Block){}
  80. Inheritance (DelayBlock, ICBlock){}
  81. Inheritance (DerivatorBlock, ICBlock){}
  82. Inheritance (IntegratorBlock, ICBlock){}
  83. Inheritance (ProbeBlock, Block){}
  84. }
  85. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime