cbd_runtime.mvc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. Class ConstantBlock{
  14. value : Float {
  15. target_lower_multiplicity = 1
  16. target_upper_multiplicity = 1
  17. }
  18. }
  19. Class AdditionBlock{}
  20. Class NegatorBlock{}
  21. Class MultiplyBlock{}
  22. Class InverseBlock{}
  23. Class DelayBlock{
  24. memory : Float {
  25. target_lower_multiplicity = 1
  26. target_upper_multiplicity = 1
  27. }
  28. }
  29. Class Schedule {
  30. block : Block {
  31. target_lower_multiplicity = 0
  32. target_upper_multiplicity = 1
  33. }
  34. next : Schedule {
  35. target_lower_multiplicity = 1
  36. target_upper_multiplicity = 1
  37. }
  38. lower_multiplicity = 1
  39. }
  40. Association Link(Block, Block){
  41. signal : Float {
  42. target_lower_multiplicity = 0
  43. target_upper_multiplicity = 1
  44. }
  45. }
  46. Association InitialCondition(Block, DelayBlock){
  47. source_lower_multiplicity = 0
  48. source_upper_multiplicity = 1
  49. }
  50. Inheritance (ConstantBlock, Block){}
  51. Inheritance (AdditionBlock, Block){}
  52. Inheritance (NegatorBlock, Block){}
  53. Inheritance (MultiplyBlock, Block){}
  54. Inheritance (InverseBlock, Block){}
  55. Inheritance (DelayBlock, Block){}
  56. }
  57. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime