Class BaseModel2
- All Implemented Interfaces:
Model
The base Model2 implementation. (This is basically just some lombok boilerplate that all models need, but it reduces clutter in the sub-class implementations)
-
Constructor Summary
ConstructorsConstructorDescriptionBaseModel2(ModelFramework framework, BoundParameters frameworkParameters, BoundParameters boundParameters, List<? extends ModelParameter> modelParameters) -
Method Summary
Modifier and TypeMethodDescriptionReturns the parameters used by theModelFrameworkto build this model (e.g.List<? extends ModelParameter>Returns a view the model's bound parameters (e.g.abstract ResultOrProblems<RealizedPipeline>realize(ExecutionContext context) Produces an executable pipeline that will 'run' the model and produce results.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nz.org.riskscape.engine.model.Model
getModelParameter
-
Constructor Details
-
BaseModel2
public BaseModel2(ModelFramework framework, BoundParameters frameworkParameters, BoundParameters boundParameters, List<? extends ModelParameter> modelParameters)
-
-
Method Details
-
realize
Description copied from interface:ModelProduces an executable pipeline that will 'run' the model and produce results.
- Specified by:
realizein interfaceModel- Returns:
- a
RealizedPipelinethat can be executed, or a list of Problems that occurred during realization.
-
getFramework
- Specified by:
getFrameworkin interfaceModel- Returns:
- what sort of
ModelFrameworkwas used to build this model.
-
getFrameworkParameters
Description copied from interface:ModelReturns the parameters used by the
ModelFrameworkto build this model (e.g. "template = default"). These parameters are so central to the model that it doesn't really make sense to override them at all, once the user has defined them.- Specified by:
getFrameworkParametersin interfaceModel
-
getBoundParameters
- Specified by:
getBoundParametersin interfaceModel- Returns:
- the configurable parameters that will be applied to the model when it is run. Note these parameters are subservient to the framework parameters that were used to create the model - change the framework parameters will likely result in a totally different set of model parameters.
-
getModelParameters
Description copied from interface:ModelReturns a view the model's bound parameters (e.g. the data in
Model.getBoundParameters()), but asModelParameters, which contains more detailed metadata.This view of the data is typically used for building user interfaces and validation, whereas the boundParameters version is there as reference for what was bound, but they should both contain the same set of parameter names.
Thinking ahead, I suspect we might want to introduce a RealizedModel class, that is returned from
Model.realize(ExecutionContext), and that version can return the model's parameters.- Specified by:
getModelParametersin interfaceModel
-