Class FWSimulationController
java.lang.Object
net.simplace.sim.control.FWSimulationController
Reads the project file (
.proj.xml) and controls the project run of a session. It creates the
iterator, generator and selector from the projects element and determines the FWSimProject.PROJECT_MODE:
- selector (with or without generator): CALIBRATION
- generator only: SENSITIVITY
- otherwise: SIMULATION (project data from XML or from a resource); without project file SOLUTION_ONLY
project/simulation elements in the XML or from a
resource (CSV, database, ...) named PROJECT_DATA. The project file may also override interfaces and
define outputs and post-processing. During the run, iterate(String), generate(String) and
select(FWSimProject) are called by the session.- Author:
- Andreas Enders
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedHashMap<String, FWSimVariable<?>> variables of the project run (solution variables, project data, control components)protected FWSimProject.PROJECT_MODEFWSimProject.PROJECT_MODEof the running projectprotected final FWSimSessionthe session -
Constructor Summary
ConstructorsConstructorDescriptionFWSimulationController(FWSimSession aSession) Creates the controller in SOLUTION_ONLY mode with the solution variables; the project file is read byinitProjectData(FileData). -
Method Summary
Modifier and TypeMethodDescriptionvoidfinalize()Finalizes the generator (returns its database connections).voidGenerates the simulations: without projects a default generator for the solution only (projectDefaultProject); in GLOBAL mode for all projects; otherwise for the given project.HashMap<String, FWSimVariable<?>> intgetProject(String aProject) Creates a new project object for an id.voidinitProjectData(FileData aProjectXMLFile) Reads the project file: interfaces, projects (control components and project data), outputs and post-processing.booleanDecides whether another iteration is run and, if so, generates its simulations (see the calibration modes inFWSimulationControlCache).voidselect(FWSimProject aProject) Selects the best simulations of the iteration (calibration only).voidsetProjectMode(FWSimProject.PROJECT_MODE aProjectMode)
-
Field Details
-
iFieldMap
variables of the project run (solution variables, project data, control components) -
iProjectMode
FWSimProject.PROJECT_MODEof the running project -
iSession
the session
-
-
Constructor Details
-
FWSimulationController
Creates the controller in SOLUTION_ONLY mode with the solution variables; the project file is read byinitProjectData(FileData).- Parameters:
aSession- the session- Throws:
SimProjectException- declared, not thrown
-
-
Method Details
-
initProjectData
Reads the project file: interfaces, projects (control components and project data), outputs and post-processing. Without project file nothing is done (SOLUTION_ONLY).- Parameters:
aProjectXMLFile- the project file, ornull- Throws:
SimProjectException- if the project file cannot be read or is invalid
-
iterate
Decides whether another iteration is run and, if so, generates its simulations (see the calibration modes inFWSimulationControlCache).- Parameters:
aProjectID- id of the project, ornullin GLOBAL mode- Returns:
trueif another iteration is run
-
generate
Generates the simulations: without projects a default generator for the solution only (projectDefaultProject); in GLOBAL mode for all projects; otherwise for the given project. Errors are logged.- Parameters:
aProjectID- id of the project, ornull
-
select
Selects the best simulations of the iteration (calibration only).- Parameters:
aProject- the project
-
finalize
-
getProjectIDs
-
getProject
Creates a new project object for an id. Note: every call creates a new object and resets the generator to its initial state.- Parameters:
aProject- id of the project- Returns:
- the new project
-
getFieldMap
- Returns:
- the variables of the project run (the live map)
-
getProjectMode
- Returns:
- the project mode
-
setProjectMode
- Parameters:
aProjectMode- the project mode
-
getCurrentProjectID
- Returns:
- the id of the current project
-
getMaxIterationCount
public int getMaxIterationCount()- Returns:
- the maximum number of iterations of the iterator, at least 1
-