A rule is used to retrieve and set variables before and after each timestep of a simulation.
NB all modifications to the database made by a rule are temporary and persist only to the end of the timestep.
Rules are stored in the directory rule and are classes that extend fr.ifremer.isisfish.rule.AbstractRule which implements the interface fr.ifremer.isisfish.rule.Rule.
Several methods are used by ISIS-Fish.
The methods are called by the simulator.
At the start of the simulation process, ISIS-Fish instantiates each of the rules selected for the simulation and calls init() for each rule. The init() method is, therefore called only once.
Then for each timestep the simulator
// debut de simulation pour toutes les règles appel de la méthode init() de la règle finpour pour chaque pas de temps // condition pour toutes les regles pour tous les metiers appel de la methode condition() // preAction pour toutes les regles pour tous les metiers si la regle est active pour ce metier appel de la methode preAction() // simulation du pas de temps // postAction pour toutes les regles pour tous les metiers si la regle est active pour ce metier appel de la méthode postAction()
The preAction() and postAction() methods are called several times for each timestep (once for each metier). If preAction() and postAction() should only act once per timestep, a trick, such as a state field, must be used to suppress the repeated actions.