Class WekaClassification

    • Field Detail

      • m_ModelFile

        protected PlaceholderFile m_ModelFile
        the serialized model to load.
      • m_Model

        protected weka.classifiers.Classifier m_Model
        the model that was loaded from the model file.
      • m_OnTheFly

        protected boolean m_OnTheFly
        whether the model gets built on the fly and might not be present at the start.
    • Constructor Detail

      • WekaClassification

        public WekaClassification()
    • Method Detail

      • modelFileTipText

        public String modelFileTipText()
        Returns the tip text for this property.
        Specified by:
        modelFileTipText in interface ModelFileHandler
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setModelActor

        public void setModelActor​(CallableActorReference value)
        Sets the callable actor to obtain the model from if model file is pointing to a directory.
        Parameters:
        value - the actor reference
      • getModelActor

        public CallableActorReference getModelActor()
        Returns the callable actor to obtain the model from if model file is pointing to a directory.
        Returns:
        the actor reference
      • modelActorTipText

        public String modelActorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOnTheFly

        public void setOnTheFly​(boolean value)
        Sets whether the model file gets built on the fly and might not be present at start up time.
        Parameters:
        value - if true then the model does not have to be present at start up time
      • getOnTheFly

        public boolean getOnTheFly()
        Returns whether the model file gets built on the fly and might not be present at start up time.
        Returns:
        true if the model is not necessarily present at start up time
      • onTheFlyTipText

        public String onTheFlyTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUpModel

        protected String setUpModel​(Actor owner)
        Loads the model from the model file.
        Parameters:
        owner - the actor this condition belongs to
        Returns:
        null if everything worked, otherwise an error message
      • setUp

        public String setUp​(Actor owner)
        Initializes the item for flow execution.
        Specified by:
        setUp in interface BooleanCondition
        Overrides:
        setUp in class AbstractBooleanCondition
        Parameters:
        owner - the actor this condition belongs to
        Returns:
        null if everything is fine, otherwise error message
      • doEvaluate

        protected boolean doEvaluate​(Actor owner,
                                     Token token)
        Performs the actual evaluation.
        Specified by:
        doEvaluate in class AbstractBooleanCondition
        Parameters:
        owner - the owning actor
        token - the current token passing through
        Returns:
        the result of the evaluation
      • getCaseIndex

        public int getCaseIndex​(Actor owner,
                                Token token)
        Returns the index of the case that should get executed.
        Specified by:
        getCaseIndex in interface IndexedBooleanCondition
        Parameters:
        owner - the owning actor
        token - the current token passing through the actor
        Returns:
        the index, -1 if not available
      • getDefaultCaseIndex

        public int getDefaultCaseIndex​(Actor owner,
                                       Token token)
        Returns the index of the default case.
        Specified by:
        getDefaultCaseIndex in interface IndexedBooleanCondition
        Parameters:
        owner - the owning actor
        token - the current token passing through the actor
        Returns:
        the index, -1 if not available