powerwindow_algebraic_loop_delay_BASE.sa 982 B

12345678910111213141516171819202122232425
  1. import PowerWindowModel
  2. import Controller_SA
  3. // this one could be joined with the one below, if we assume certain priorities in executing the rules
  4. semantic adaptation WindowSA window_sa
  5. at "./path/to/WindowSA.fmu"
  6. for fmu window
  7. out rules {
  8. true -> { } --> { reaction_torque := -reaction_torque; };
  9. }
  10. // algebraic loop, simply use delay... written in baseDSL
  11. semantic adaptation WindowSADelay window_sa_delay //with master
  12. at "./path/to/WindowSADelay.fmu"
  13. for fmu window_sa // inner SA, makes it possible to enforce order among adaptations this way
  14. param init_height := 0;
  15. param init_reaction_torque := 0;
  16. out var stored_height := init_height;
  17. out var stored_reaction_torque := init_reaction_torque;
  18. out rules {
  19. true -> { var temp_height := height; height := stored_height; stored_height := temp_height; } --> { };
  20. true -> { var temp_reaction_torque := reaction_torque; reaction_torque := stored_reaction_torque; stored_reaction_torque := temp_reaction_torque; } --> { };
  21. }