SmartEngine  1.6.0
Public Member Functions | List of all members
SmartEngine::IGraphManager Class Referenceabstract

Connects graph controllers with graph models. Graph controllers define a single use of a graph. They pipe data to the model and later act on the output of the model. The model (usually a graph, but can be a dummy class) has the job of aggregating the input from one or more controllers and producing an output for each. More...

#include <GraphModel.h>

Inheritance diagram for SmartEngine::IGraphManager:
SmartEngine::IObject

Public Member Functions

virtual void RegisterController (IGraphController *controller, const char *modelName, float updateRate=cDefaultUpdateRate)=0
 Registers a controller to the given model name. If the controller is already registered, it is unregistered and re-registered to the new model. More...
 
virtual void UnregisterController (IGraphController *controller)=0
 Unregisters a controller. It will no longer receive output data. More...
 
virtual bool IsControllerRegistered (IGraphController *controller) const =0
 Returns true if the controller is registered with us. More...
 
virtual void RegisterAgent (IAgent *agent, IGraphController *controller)=0
 Registers an agent for the specified controller. The agent will automatically start new experiences and push observation / action state during Execute(). More...
 
virtual void UnregisterAgent (IAgent *agent)=0
 Unregisters an agent More...
 
virtual void RegisterModel (IGraphModel *model, const char *modelName, float updateRate=cUpdateEveryFrameRate)=0
 Registers a model with the given name and update rate. If a model with the given name is already registered, this will replace it. More...
 
virtual void RegisterModelFromGraph (IGraph *graph, const char *modelName, float updateRate=cUpdateEveryFrameRate)=0
 Registers a graph as a model with the given name and update rate. If a model with the given name is already registered, this will replace it. More...
 
virtual void RegisterModelFromGraphResource (const char *resourceName, const char *modelName, float updateRate=cUpdateEveryFrameRate)=0
 Registers a model with the given name and update rate. This will generate a standard model from a graph resource. If a model with the given name is already registered, this will replace it. More...
 
virtual void UnregisterModel (const char *modelName)=0
 Unregisters a model. Any connected controllers will no longer receive data. More...
 
virtual void Update (float deltaTime)=0
 Advance the models ahead in time, updating controllers as necessary. More...
 
virtual void UpdateController (IGraphController *controller)=0
 Updates a controller now. This is the only way to update manually stepped controllers. More...
 
virtual void BeginStreaming (IGraphController *controller)=0
 Streaming lets you feed in chunks of data over time into the model. After beginning the stream, the application goes into a loop of set the input on the controller followed by pushing that data to the model. This is useful when setting up a gradient descent trainer because you can reuse a model view that acts on one row of a time to build up the graph input buffers with multiple rows of data. More...
 
virtual void PushStreamData (IGraphController *controller)=0
 Pushes whatever inputs are set on the controller into the model. The model will not be cleared during this operation, so the data will be appended to what it currently has. More...
 
virtual MatrixIndex GetStreamingInputRowCount (IGraphController *controller) const =0
 Returns the current number of streamed rows currently pushed to the model. If the input buffers have an inconsistent number of rows pushed, this returns -1. More...
 
virtual void EndStreaming (IGraphController *controller)=0
 Ends the streaming cycle. The graph will execute any requested outputs. More...
 
virtual void Reset ()=0
 Resets all models. More...
 
- Public Member Functions inherited from SmartEngine::IObject
virtual ObjectId GetId () const =0
 Returns the ID of this object. More...
 
virtual void AddRef () const =0
 Increments the internal reference count on this object. It is not common to use this method directly. More...
 
virtual void Release () const =0
 Decrements the internal reference count on this object. It is not common to use this method directly. More...
 
virtual int GetRefCount () const =0
 Returns the number of references to this object. More...
 
virtual void * QueryInterface (ObjectClassId id)=0
 Queries the object for an interface and returns a pointer to that interface if found. More...
 
void operator= (IObject const &x)=delete
 

Additional Inherited Members

- Public Attributes inherited from SmartEngine::IObject
 private
 
 __pad0__: IObject() {} IObject(IObject const&) = delete
 

Detailed Description

Connects graph controllers with graph models. Graph controllers define a single use of a graph. They pipe data to the model and later act on the output of the model. The model (usually a graph, but can be a dummy class) has the job of aggregating the input from one or more controllers and producing an output for each.

This class manages the stepping of the controller <-> model flow, letting controllers connect with models in a discoupled manner.

Member Function Documentation

◆ BeginStreaming()

virtual void SmartEngine::IGraphManager::BeginStreaming ( IGraphController controller)
pure virtual

Streaming lets you feed in chunks of data over time into the model. After beginning the stream, the application goes into a loop of set the input on the controller followed by pushing that data to the model. This is useful when setting up a gradient descent trainer because you can reuse a model view that acts on one row of a time to build up the graph input buffers with multiple rows of data.

Multiple controllers can be streaming at a time, but they should each be mapped to separate models. Don't call other update methods until exiting immediate mode.

◆ EndStreaming()

virtual void SmartEngine::IGraphManager::EndStreaming ( IGraphController controller)
pure virtual

Ends the streaming cycle. The graph will execute any requested outputs.

◆ GetStreamingInputRowCount()

virtual MatrixIndex SmartEngine::IGraphManager::GetStreamingInputRowCount ( IGraphController controller) const
pure virtual

Returns the current number of streamed rows currently pushed to the model. If the input buffers have an inconsistent number of rows pushed, this returns -1.

◆ IsControllerRegistered()

virtual bool SmartEngine::IGraphManager::IsControllerRegistered ( IGraphController controller) const
pure virtual

Returns true if the controller is registered with us.

◆ PushStreamData()

virtual void SmartEngine::IGraphManager::PushStreamData ( IGraphController controller)
pure virtual

Pushes whatever inputs are set on the controller into the model. The model will not be cleared during this operation, so the data will be appended to what it currently has.

◆ RegisterAgent()

virtual void SmartEngine::IGraphManager::RegisterAgent ( IAgent agent,
IGraphController controller 
)
pure virtual

Registers an agent for the specified controller. The agent will automatically start new experiences and push observation / action state during Execute().

[StartNewExperience()](IAgent::StartNewExperience] will be called at the beginning of the controller update.

◆ RegisterController()

virtual void SmartEngine::IGraphManager::RegisterController ( IGraphController controller,
const char *  modelName,
float  updateRate = cDefaultUpdateRate 
)
pure virtual

Registers a controller to the given model name. If the controller is already registered, it is unregistered and re-registered to the new model.

Parameters
updateRateDefines how often the model should update controllers in seconds / update. See cDefaultUpdateRate, cUpdateEveryFrameRate, and cUpdateManuallyRate

◆ RegisterModel()

virtual void SmartEngine::IGraphManager::RegisterModel ( IGraphModel model,
const char *  modelName,
float  updateRate = cUpdateEveryFrameRate 
)
pure virtual

Registers a model with the given name and update rate. If a model with the given name is already registered, this will replace it.

Parameters
updateRateDefines how often the model should update controllers in seconds / update. See cUpdateEveryFrameRate and cUpdateManuallyRate

◆ RegisterModelFromGraph()

virtual void SmartEngine::IGraphManager::RegisterModelFromGraph ( IGraph graph,
const char *  modelName,
float  updateRate = cUpdateEveryFrameRate 
)
pure virtual

Registers a graph as a model with the given name and update rate. If a model with the given name is already registered, this will replace it.

Parameters
updateRateDefines how often the model should update controllers in seconds / update. See cUpdateEveryFrameRate and cUpdateManuallyRate

◆ RegisterModelFromGraphResource()

virtual void SmartEngine::IGraphManager::RegisterModelFromGraphResource ( const char *  resourceName,
const char *  modelName,
float  updateRate = cUpdateEveryFrameRate 
)
pure virtual

Registers a model with the given name and update rate. This will generate a standard model from a graph resource. If a model with the given name is already registered, this will replace it.

Parameters
updateRateDefines how often the model should update controllers in seconds / update. See cUpdateEveryFrameRate and cUpdateManuallyRate

◆ Reset()

virtual void SmartEngine::IGraphManager::Reset ( )
pure virtual

Resets all models.

◆ UnregisterAgent()

virtual void SmartEngine::IGraphManager::UnregisterAgent ( IAgent agent)
pure virtual

Unregisters an agent

◆ UnregisterController()

virtual void SmartEngine::IGraphManager::UnregisterController ( IGraphController controller)
pure virtual

Unregisters a controller. It will no longer receive output data.

◆ UnregisterModel()

virtual void SmartEngine::IGraphManager::UnregisterModel ( const char *  modelName)
pure virtual

Unregisters a model. Any connected controllers will no longer receive data.

◆ Update()

virtual void SmartEngine::IGraphManager::Update ( float  deltaTime)
pure virtual

Advance the models ahead in time, updating controllers as necessary.

◆ UpdateController()

virtual void SmartEngine::IGraphManager::UpdateController ( IGraphController controller)
pure virtual

Updates a controller now. This is the only way to update manually stepped controllers.