|
SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Agent is a base class for all SMTK agents. More...
#include <Agent.h>
Public Types | |
| enum | CategoryEvaluation { CategoryEvaluation::Pass, CategoryEvaluation::Reject, CategoryEvaluation::Neutral } |
| The set of values that an agent's acceptChildCategories method can return. More... | |
| using | State = smtk::task::State |
| using | Configuration = nlohmann::json |
Public Member Functions | |
| smtkTypeMacroBase (smtk::task::Agent) | |
| Agent (Task *owningTask) | |
| virtual State | state () const =0 |
| Return the current state of the agent. | |
| virtual void | configure (const Configuration &config) |
| Configure the agent based on a provided JSON configuration. More... | |
| virtual Configuration | configuration () const |
| Return the agent's configuration. | |
| virtual std::shared_ptr< PortData > | portData (const Port *port) const |
| Return the port data from the agent. More... | |
| virtual void | portDataUpdated (const Port *port) |
| Tell the agent that the data on port has been updated. More... | |
| Task * | parent () const |
| Return the agent's parent task. | |
| virtual std::string | troubleshoot () const |
| Return a description of actions users must take to make the agent's state completable. More... | |
| virtual bool | getViewData (smtk::common::TypeContainer &configuration) const |
| Insert view-related objects into configuration. More... | |
| smtk::string::Token | name () const |
| Agents may have a name that can be used to distinguish them. More... | |
| virtual CategoryEvaluation | acceptsChildCategories (const std::set< std::string > &cats) const |
| Evaluates a set of categories that are associated with potential children tasks. | |
Protected Member Functions | |
| virtual void | taskStateChanged (State prev, State &next) |
| Receive notification the parent Task's state has changed. | |
| virtual void | taskStateChanged (Task *task, State prev, State next) |
| Receive notification that a Task's state has changed. More... | |
Protected Attributes | |
| smtk::task::Task * | m_parent |
| smtk::string::Token | m_name |
| A name that can be used to distinguish instances of agents. | |
Friends | |
| class | Task |
Agent is a base class for all SMTK agents.
SMTK agents work within a Task and are used to both configure a task and validate task's state. Agents can be assigned to the ports of a task and control how the task responds to new data that is available on its input ports as well as the data produced on its output ports.
Subclasses of Agent are responsible for providing custom behavior that is required by the task in order for it to perform properly.
|
strong |
The set of values that an agent's acceptChildCategories method can return.
|
virtual |
Configure the agent based on a provided JSON configuration.
The base implementation will set m_name if provided.
Reimplemented in smtk::task::SubmitOperationAgent, smtk::task::PortForwardingAgent, smtk::task::FillOutAttributesAgent, smtk::task::TrivialProducerAgent, smtk::task::GatherObjectsAgent, and smtk::task::ChildCategoriesAgent.
|
virtual |
Insert view-related objects into configuration.
Subclasses should override this; the default implementation does nothing. This method should return true when configuration is modified and false otherwise.
Reimplemented in smtk::task::FillOutAttributesAgent.
|
inline |
Agents may have a name that can be used to distinguish them.
You are allowed to create multiple instances of an Agent subclass assigned to the same task. In order to distinguish them, you may assign them names. You are not required to name agents. Names must be specified by data passed to Agent::configure().
Return the port data from the agent.
If the agent is not assigned to port, the method returns nullptr.
Reimplemented in smtk::task::SubmitOperationAgent, smtk::task::PortForwardingAgent, smtk::task::FillOutAttributesAgent, smtk::task::TrivialProducerAgent, and smtk::task::GatherObjectsAgent.
|
virtual |
Tell the agent that the data on port has been updated.
This will be called when an input port connection is modified upstream of this agent, so port should always be an input port of this agent's parent task.
Reimplemented in smtk::task::SubmitOperationAgent, smtk::task::PortForwardingAgent, and smtk::task::FillOutAttributesAgent.
Receive notification that a Task's state has changed.
This method would allow a Task to delegate children state calculation to an Agent instead
Reimplemented in smtk::task::SubmitOperationAgent, and smtk::task::FillOutAttributesAgent.
|
inlinevirtual |
Return a description of actions users must take to make the agent's state completable.
Subclasses should override this method.
This should be XHTML text that can be inserted into an unordered HTML list (
) along with the text from other agent instances.
This should be an empty string when the agent's state is either completable or completed.
Reimplemented in smtk::task::SubmitOperationAgent, and smtk::task::TrivialProducerAgent.
1.8.17