cbd_runtime.mvc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. signal : Float {
  14. target_lower_cardinality = 1
  15. target_upper_cardinality = 1
  16. }
  17. }
  18. Class ICBlock{
  19. last_in : Float {
  20. target_lower_cardinality = 0
  21. target_upper_cardinality = 1
  22. }
  23. }
  24. Class ConstantBlock{
  25. value : Float {
  26. target_lower_cardinality = 1
  27. target_upper_cardinality = 1
  28. }
  29. }
  30. Class AdditionBlock{}
  31. Class NegatorBlock{}
  32. Class MultiplyBlock{}
  33. Class InverseBlock{}
  34. Class DelayBlock{}
  35. Class IntegratorBlock{
  36. last_out : Float {
  37. target_lower_cardinality = 0
  38. target_upper_cardinality = 1
  39. }
  40. }
  41. Class DerivatorBlock{}
  42. Class Time{
  43. lower_cardinality = 1
  44. upper_cardinality = 1
  45. start_time : Float {
  46. target_lower_cardinality = 1
  47. target_upper_cardinality = 1
  48. }
  49. current_time : Float {
  50. target_lower_cardinality = 1
  51. target_upper_cardinality = 1
  52. }
  53. }
  54. Association Link(Block, Block){
  55. }
  56. Association InitialCondition(Block, ICBlock){
  57. source_lower_cardinality = 0
  58. source_upper_cardinality = 1
  59. }
  60. Inheritance (ConstantBlock, Block){}
  61. Inheritance (AdditionBlock, Block){}
  62. Inheritance (NegatorBlock, Block){}
  63. Inheritance (MultiplyBlock, Block){}
  64. Inheritance (InverseBlock, Block){}
  65. Inheritance (ICBlock, Block){}
  66. Inheritance (DelayBlock, ICBlock){}
  67. Inheritance (DerivatorBlock, ICBlock){}
  68. Inheritance (IntegratorBlock, ICBlock){}
  69. }
  70. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime