cbd_runtime.mvc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 ConstantBlock{
  27. value : Float {
  28. target_lower_cardinality = 1
  29. target_upper_cardinality = 1
  30. }
  31. }
  32. Class AdditionBlock{}
  33. Class NegatorBlock{}
  34. Class MultiplyBlock{}
  35. Class InverseBlock{}
  36. Class DelayBlock{
  37. memory : Float {
  38. target_lower_cardinality = 0
  39. target_upper_cardinality = 1
  40. }
  41. }
  42. Class Time{
  43. lower_cardinality = 1
  44. upper_cardinality = 1
  45. start_time : Natural {
  46. target_lower_cardinality = 1
  47. target_upper_cardinality = 1
  48. }
  49. current_time : Natural {
  50. target_lower_cardinality = 1
  51. target_upper_cardinality = 1
  52. }
  53. }
  54. Association Link(Block, Block){
  55. }
  56. Association InitialCondition(Block, DelayBlock){
  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 (DelayBlock, Block){}
  66. }
  67. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime