cbd_runtime.mvc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. Class ConstantBlock{
  28. value : Float {
  29. target_lower_cardinality = 1
  30. target_upper_cardinality = 1
  31. }
  32. }
  33. Class AdditionBlock{}
  34. Class NegatorBlock{}
  35. Class MultiplyBlock{}
  36. Class InverseBlock{}
  37. Class DelayBlock{
  38. memory : Float {
  39. target_lower_cardinality = 0
  40. target_upper_cardinality = 1
  41. }
  42. }
  43. Class IntegratorBlock{
  44. last_in : Float {
  45. target_lower_cardinality = 0
  46. target_upper_cardinality = 1
  47. }
  48. last_out : Float {
  49. target_lower_cardinality = 0
  50. target_upper_cardinality = 1
  51. }
  52. }
  53. Class DerivatorBlock{
  54. last_in : Float {
  55. target_lower_cardinality = 0
  56. target_upper_cardinality = 1
  57. }
  58. }
  59. Class Time{
  60. lower_cardinality = 1
  61. upper_cardinality = 1
  62. start_time : Natural {
  63. target_lower_cardinality = 1
  64. target_upper_cardinality = 1
  65. }
  66. current_time : Natural {
  67. target_lower_cardinality = 1
  68. target_upper_cardinality = 1
  69. }
  70. }
  71. Association Link(Block, Block){
  72. }
  73. Association InitialCondition(Block, ICBlock){
  74. source_lower_cardinality = 0
  75. source_upper_cardinality = 1
  76. }
  77. Inheritance (ConstantBlock, Block){}
  78. Inheritance (AdditionBlock, Block){}
  79. Inheritance (NegatorBlock, Block){}
  80. Inheritance (MultiplyBlock, Block){}
  81. Inheritance (InverseBlock, Block){}
  82. Inheritance (ICBlock, Block){}
  83. Inheritance (DelayBlock, ICBlock){}
  84. Inheritance (DerivatorBlock, ICBlock){}
  85. Inheritance (IntegratorBlock, ICBlock){}
  86. }
  87. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime