cbd_runtime.mvc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import models/SimpleClassDiagrams as SCD
  2. include "primitives.alh"
  3. SCD CausalBlockDiagrams{
  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. output : Block {
  14. target_lower_multiplicity = 1
  15. target_upper_multiplicity = 1
  16. }
  17. signal : Float {
  18. target_lower_multiplicity = 1
  19. target_upper_multiplicity = 1
  20. }
  21. }
  22. Class ConstantBlock{
  23. value : Float {
  24. target_lower_multiplicity = 1
  25. target_upper_multiplicity = 1
  26. }
  27. }
  28. Class AdditionBlock{
  29. input1 : Block {
  30. target_lower_multiplicity = 1
  31. target_upper_multiplicity = 1
  32. }
  33. input2 : Block {
  34. target_lower_multiplicity = 1
  35. target_upper_multiplicity = 1
  36. }
  37. }
  38. Class NegatorBlock{
  39. input1 : Block {
  40. target_lower_multiplicity = 1
  41. target_upper_multiplicity = 1
  42. }
  43. input2 : Block {
  44. target_lower_multiplicity = 1
  45. target_upper_multiplicity = 1
  46. }
  47. }
  48. Class MultiplyBlock{
  49. input1 : Block {
  50. target_lower_multiplicity = 1
  51. target_upper_multiplicity = 1
  52. }
  53. input2 : Block {
  54. target_lower_multiplicity = 1
  55. target_upper_multiplicity = 1
  56. }
  57. }
  58. Class InverseBlock{
  59. input1 : Block {
  60. target_lower_multiplicity = 1
  61. target_upper_multiplicity = 1
  62. }
  63. }
  64. Class DelayBlock{
  65. input : Block {
  66. target_lower_multiplicity = 1
  67. target_upper_multiplicity = 1
  68. }
  69. initial : Block {
  70. target_lower_multiplicity = 1
  71. target_upper_multiplicity = 1
  72. }
  73. memory : Float {
  74. target_lower_multiplicity = 1
  75. target_upper_multiplicity = 1
  76. }
  77. }
  78. Inheritance (ConstantBlock, Block){}
  79. Inheritance (AdditionBlock, Block){}
  80. Inheritance (NegatorBlock, Block){}
  81. Inheritance (MultiplyBlock, Block){}
  82. Inheritance (InverseBlock, Block){}
  83. Inheritance (DelayBlock, Block){}
  84. }
  85. export CausalBlockDiagrams to models/CausalBlockDiagrams