powerwindow_algebraic_loop_delay_BASE.sa 895 B

1234567891011121314151617181920212223
  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 window_sa
  5. for fmu window
  6. out rules {
  7. true -> {reaction_torque := -reaction_torque; } --> { };
  8. }
  9. // algebraic loop, simply use delay... written in baseDSL
  10. semantic adaptation window_sa_delay //with master
  11. for fmu window_sa // inner SA, makes it possible to enforce order among adaptations this way
  12. param init_height = 0;
  13. param init_reaction_torque = 0;
  14. out var stored_height := init_height;
  15. out var stored_reaction_torque := init_reaction_torque;
  16. out rules {
  17. true -> { var temp_height := height; height := stored_height; stored_height := temp_height; } --> { };
  18. true -> { var temp_reaction_torque := reaction_torque; reaction_torque := stored_reaction_torque; stored_reaction_torque := temp_reaction_torque; } --> { };
  19. }