cbd_runtime.mvc 2.5 KB

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