cbd_runtime.mvc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 Natural {
  13. $
  14. if (bool_not(is_physical_int(self))):
  15. return "Natural has no integer 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 AdditionBlock{}
  39. Class NegatorBlock{}
  40. Class MultiplyBlock{}
  41. Class InverseBlock{}
  42. Class DelayBlock{}
  43. Class IntegratorBlock{
  44. last_out : Float {
  45. target_lower_cardinality = 0
  46. target_upper_cardinality = 1
  47. }
  48. }
  49. Class DerivatorBlock{}
  50. Class Time{
  51. lower_cardinality = 1
  52. upper_cardinality = 1
  53. start_time : Natural {
  54. target_lower_cardinality = 1
  55. target_upper_cardinality = 1
  56. }
  57. current_time : Natural {
  58. target_lower_cardinality = 1
  59. target_upper_cardinality = 1
  60. }
  61. }
  62. Association Link(Block, Block){
  63. }
  64. Association InitialCondition(Block, ICBlock){
  65. source_lower_cardinality = 0
  66. source_upper_cardinality = 1
  67. }
  68. Inheritance (ConstantBlock, Block){}
  69. Inheritance (AdditionBlock, Block){}
  70. Inheritance (NegatorBlock, Block){}
  71. Inheritance (MultiplyBlock, Block){}
  72. Inheritance (InverseBlock, Block){}
  73. Inheritance (ICBlock, Block){}
  74. Inheritance (DelayBlock, ICBlock){}
  75. Inheritance (DerivatorBlock, ICBlock){}
  76. Inheritance (IntegratorBlock, ICBlock){}
  77. }
  78. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime