12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import models/SimpleClassDiagrams as SCD
- include "primitives.alh"
- SCD CausalBlockDiagrams{
- Class Float {
- $
- if (bool_not(is_physical_float(self))):
- return "Natural has no float value"!
- else:
- return "OK"!
- $
- }
- Class Block{
- output : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- }
- Class ConstantBlock{
- value : Float {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- }
- Class AdditionBlock{
- input1 : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- input2 : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- }
- Class NegatorBlock{
- input1 : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- input2 : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- }
- Class MultiplyBlock{
- input1 : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- input2 : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- }
- Class InverseBlock{
- input1 : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- }
- Class DelayBlock{
- input : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- initial : Block {
- target_lower_multiplicity = 1
- target_upper_multiplicity = 1
- }
- }
- Inheritance (ConstantBlock, Block){}
- Inheritance (AdditionBlock, Block){}
- Inheritance (NegatorBlock, Block){}
- Inheritance (MultiplyBlock, Block){}
- Inheritance (InverseBlock, Block){}
- Inheritance (DelayBlock, Block){}
- }
- export CausalBlockDiagrams to models/CausalBlockDiagrams
|