Package fr.ifremer.isisfish.simulator
Class OptimizationContextInternal
java.lang.Object
fr.ifremer.isisfish.simulator.SimulationPlanContextInternal
fr.ifremer.isisfish.simulator.OptimizationContextInternal
- All Implemented Interfaces:
OptimizationContext
,SimulationPlanContext
public class OptimizationContextInternal
extends SimulationPlanContextInternal
implements OptimizationContext
Context utilisé pour gérer les différentes simulation lancées par un script d'optimisation.
- Since:
- 4.3.0.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected List<List<SimulationStorage>>
protected SimulationJob
protected List<SimulationStorage>
Simulation to do during next generation simulationFields inherited from class fr.ifremer.isisfish.simulator.SimulationPlanContextInternal
historic, id, number, param, values
Fields inherited from interface fr.ifremer.isisfish.simulator.OptimizationContext
TEMP_PREFIX
-
Constructor Summary
ConstructorDescriptionOptimizationContextInternal
(String id, SimulationParameter param, SimulationJob job) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Get simulation to do, put it generations and increment currentGeneration This method must be call be Simulator when it want to get next simulations to do.int
Return the current generation.getGeneration
(int n) Return simulation for generation nReturn last generation simulations.Return next generation, in endGeneration, this method return all time empty list.int
void
Return new simulation.newSimulation
(Factor... factors) Create simulation.Methods inherited from class fr.ifremer.isisfish.simulator.SimulationPlanContextInternal
getHistoric, getId, getLastSimulation, getNumber, getParam, getSimulation, getValue, incNumber, setValue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface fr.ifremer.isisfish.simulator.SimulationPlanContext
getHistoric, getId, getLastSimulation, getNumber, getParam, getSimulation, getValue, setValue
-
Field Details
-
job
-
generationNumber
protected int generationNumber -
generations
-
nextSimulations
Simulation to do during next generation simulation
-
-
Constructor Details
-
OptimizationContextInternal
-
-
Method Details
-
getNextSimulations
Description copied from interface:OptimizationContext
Return next generation, in endGeneration, this method return all time empty list.- Specified by:
getNextSimulations
in interfaceOptimizationContext
- Returns:
-
clearNextSimulation
Get simulation to do, put it generations and increment currentGeneration This method must be call be Simulator when it want to get next simulations to do.- Returns:
- null or empty collection if no more simulation to do
-
getLastSimulations
Description copied from interface:OptimizationContext
Return last generation simulations.- Specified by:
getLastSimulations
in interfaceOptimizationContext
- Returns:
-
newSimulation
Return new simulation. This new simulation is automaticaly added to next simulation.- Specified by:
newSimulation
in interfaceOptimizationContext
- Returns:
- new Simulation
-
addSimulation
-
newSimulation
Create simulation. This new simulation is automatically added to next simulations. Database will be modified with factors in parameters- Specified by:
newSimulation
in interfaceOptimizationContext
- Parameters:
factors
- factors used to modify simulation- Returns:
- simulation modified with factors
-
getCurrentGeneration
public int getCurrentGeneration()Return the current generation. 0 for no generation 1 for one generation simulation ...- Specified by:
getCurrentGeneration
in interfaceOptimizationContext
- Returns:
-
incGenerationNumber
public void incGenerationNumber() -
getSimulationNumber
public int getSimulationNumber() -
getGeneration
Description copied from interface:OptimizationContext
Return simulation for generation n- Specified by:
getGeneration
in interfaceOptimizationContext
- Parameters:
n
- generation number- Returns:
-