Class BaseModelRunCommand

java.lang.Object
nz.org.riskscape.engine.cli.ApplicationCommand
nz.org.riskscape.engine.cli.model.BaseModelRunCommand
All Implemented Interfaces:
AutoCloseable, nz.org.riskscape.engine.cli.ChildCommand, nz.org.riskscape.engine.cli.EngineCommand, nz.org.riskscape.engine.cli.PipelineRenderer, nz.org.riskscape.engine.cli.TerminalCommand
Direct Known Subclasses:
BatchCommand, RunCommand

public abstract class BaseModelRunCommand extends nz.org.riskscape.engine.cli.ApplicationCommand implements nz.org.riskscape.engine.cli.PipelineRenderer
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
     
     
     
     
     
     
     
    boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Map<String,List<String>>
     
    protected LocalDateTime
     
    protected nz.org.riskscape.engine.pipeline.RealizedPipeline
    realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext)
     
    protected nz.org.riskscape.engine.pipeline.RealizedPipeline
    realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext, boolean allowFailures)
     
    protected nz.org.riskscape.engine.model.Model
    updateParameters(nz.org.riskscape.engine.model.Model model, Map<String,List<String>> cliParameters)
     
    protected void
    warnIfCannotOverrideFormat(nz.org.riskscape.engine.pipeline.RealizedPipeline pipeline, nz.org.riskscape.engine.output.Format formatOverride, nz.org.riskscape.problem.ProblemSink problemSink)
    The save format may already be specified as part of the model itself.

    Methods inherited from class nz.org.riskscape.engine.cli.ApplicationCommand

    asPropertyWithProblems, bindOutput, combineKeyValuesForDisplay, displayWithProblems, doCommand, formatFailedObjectErrorsForTable, formatProblemsForTableText, getDetailedHelp, getEngine, getMessages, getObject, getProject, getTerminal, paramString, parseJsonArguments, parseJsonArguments, resourceFrom, run, setEngine, setMessages, setProject, setTerminal

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.cli.EngineCommand

    close

    Methods inherited from interface nz.org.riskscape.engine.cli.PipelineRenderer

    boundPipelineParameterToString, graph, printPipeline, printPipeline, printType

    Methods inherited from interface nz.org.riskscape.engine.cli.TerminalCommand

    print, printerr, stderr, stdin, stdout
  • Field Details

    • modelId

      public String modelId
    • output

      public String output
    • replace

      public boolean replace
    • checksum

      public boolean checksum
    • progressIndicator

      public String progressIndicator
    • parametersFile

      public Path parametersFile
    • parameters

      public List<String> parameters
    • format

      public String format
  • Constructor Details

    • BaseModelRunCommand

      public BaseModelRunCommand()
  • Method Details

    • warnIfCannotOverrideFormat

      protected void warnIfCannotOverrideFormat(nz.org.riskscape.engine.pipeline.RealizedPipeline pipeline, nz.org.riskscape.engine.output.Format formatOverride, nz.org.riskscape.problem.ProblemSink problemSink)

      The save format may already be specified as part of the model itself. In these cases, we can't override it easily because that would require knowledge of the ModelFramework's inner workings (e.g. save format in pipeline models will be different to wizard models). Instead, log a warning in case the user is expecting the --format behaviour to work differently.

    • getCliParameterMap

      protected Map<String,List<String>> getCliParameterMap()
    • updateParameters

      protected nz.org.riskscape.engine.model.Model updateParameters(nz.org.riskscape.engine.model.Model model, Map<String,List<String>> cliParameters)
    • realize

      protected nz.org.riskscape.engine.pipeline.RealizedPipeline realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext)
    • realize

      protected nz.org.riskscape.engine.pipeline.RealizedPipeline realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext, boolean allowFailures)
    • getCurrentTime

      protected LocalDateTime getCurrentTime()