cbd_runtime.mvc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import models/SimpleClassDiagrams as SCD
  2. include "primitives.alh"
  3. SCD CausalBlockDiagrams_Runtime{
  4. AttributeValue Float {
  5. constraint = $
  6. String constraint(model : Element, name : String):
  7. if (bool_not(is_physical_float(model["model"][name]))):
  8. return "Float has no float value"!
  9. else:
  10. return "OK"!
  11. $
  12. }
  13. AttributeValue String {
  14. constraint = $
  15. String constraint(model : Element, name : String):
  16. if (bool_not(is_physical_string(model["model"][name]))):
  17. return "String has no string value"!
  18. else:
  19. return "OK"!
  20. $
  21. }
  22. Class Block{
  23. signal : Float
  24. }
  25. Class ICBlock{
  26. last_in : Float
  27. }
  28. Class ConstantBlock{
  29. value : Float
  30. }
  31. Class ProbeBlock{
  32. name : String
  33. }
  34. Class AdditionBlock{}
  35. Class NegatorBlock{}
  36. Class MultiplyBlock{}
  37. Class InverseBlock{}
  38. Class DelayBlock{}
  39. Class IntegratorBlock{
  40. last_out? : Float
  41. }
  42. Class DerivatorBlock{}
  43. Class Time{
  44. lower_cardinality = 1
  45. upper_cardinality = 1
  46. start_time : Float
  47. current_time : Float
  48. }
  49. Association Link(Block, Block){
  50. }
  51. Association InitialCondition(Block, ICBlock){
  52. source_lower_cardinality = 0
  53. source_upper_cardinality = 1
  54. }
  55. Inheritance (ConstantBlock, Block){}
  56. Inheritance (AdditionBlock, Block){}
  57. Inheritance (NegatorBlock, Block){}
  58. Inheritance (MultiplyBlock, Block){}
  59. Inheritance (InverseBlock, Block){}
  60. Inheritance (ICBlock, Block){}
  61. Inheritance (DelayBlock, ICBlock){}
  62. Inheritance (DerivatorBlock, ICBlock){}
  63. Inheritance (IntegratorBlock, ICBlock){}
  64. Inheritance (ProbeBlock, Block){}
  65. }
  66. export CausalBlockDiagrams_Runtime to models/CausalBlockDiagrams_Runtime