cbd_runtime.mvc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_cardinality = 1
  16. target_upper_cardinality = 1
  17. }
  18. }
  19. Class AdditionBlock{}
  20. Class NegatorBlock{}
  21. Class MultiplyBlock{}
  22. Class InverseBlock{}
  23. Class DelayBlock{
  24. memory : Float {
  25. target_lower_cardinality = 1
  26. target_upper_cardinality = 1
  27. }
  28. }
  29. Class Pointers {
  30. lower_cardinality = 1
  31. upper_cardinality = 1
  32. }
  33. Class Schedule {
  34. lower_cardinality = 1
  35. }
  36. Association LinkedBlock(Schedule, Block){
  37. target_lower_cardinality = 0
  38. target_upper_cardinality = 1
  39. }
  40. Association NextSchedule(Schedule, Schedule){
  41. target_lower_cardinality = 0
  42. target_upper_cardinality = 1
  43. }
  44. Association ActiveSchedule(Pointers, Schedule) {
  45. target_lower_cardinality = 1
  46. target_upper_cardinality = 1
  47. }
  48. Association Link(Block, Block){
  49. signal : Float {
  50. target_lower_cardinality = 0
  51. target_upper_cardinality = 1
  52. }
  53. }
  54. Association InitialCondition(Block, DelayBlock){
  55. source_lower_cardinality = 0
  56. source_upper_cardinality = 1
  57. }
  58. Inheritance (ConstantBlock, Block){}
  59. Inheritance (AdditionBlock, Block){}
  60. Inheritance (NegatorBlock, Block){}
  61. Inheritance (MultiplyBlock, Block){}
  62. Inheritance (InverseBlock, Block){}
  63. Inheritance (DelayBlock, Block){}
  64. }
  65. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime