Class BaseModelFramework
- All Implemented Interfaces:
nz.org.riskscape.engine.Identified,nz.org.riskscape.engine.model.ModelFramework
- Direct Known Subclasses:
ParameterizedPipelineModelFramework
Base class for ModelFrameworks - so far this is just a place for a convenient method for handling an
incomplete ParameterSet to live.
TOOD consider making this a bit more structured and follow an open-closed design, like with
BaseBookmarkResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.model.Model>buildWithIncompleteParameters(nz.org.riskscape.engine.bind.BoundParameters modelParameters, Function<nz.org.riskscape.engine.bind.BoundParameters, nz.org.riskscape.engine.model.Model> modelBuilder) Builds the model if the supplied parameters have no problems except for missing parameters.protected booleanIf true (the default) an extraneous parameter in the bound set of model parameters will add a warning to the Model that is built.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.Identified
getId, getIdentifiedClassMethods inherited from interface nz.org.riskscape.engine.model.ModelFramework
build, getBuildParameterSet
-
Constructor Details
-
BaseModelFramework
public BaseModelFramework()
-
-
Method Details
-
buildWithIncompleteParameters
protected nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.model.Model> buildWithIncompleteParameters(nz.org.riskscape.engine.bind.BoundParameters modelParameters, Function<nz.org.riskscape.engine.bind.BoundParameters, nz.org.riskscape.engine.model.Model> modelBuilder) Builds the model if the supplied parameters have no problems except for missing parameters. We expect some parameters to be missing, they are for the user to enter when running the model.
Note that warnings will be added if there are any unexpected parameters (unless shouldWarnOnUnusedParameters returns false).
- Parameters:
modelParameters-modelBuilder-- Returns:
- ResultOrProblems
-
shouldWarnOnUnusedParameters
protected boolean shouldWarnOnUnusedParameters()If true (the default) an extraneous parameter in the bound set of model parameters will add a warning to the Model that is built. If false, it's assumed the sub-class either wants them or will warn its own damn self.
-