AnyLogic AnyLogic
Expand
Font size
All Known Implementing Classes:
ExperimentReinforcementLearning

public interface ReinforcementLearningModel<ROOT extends Agent,​O,​A,​C>

Method Summary

All Methods Instance Methods Abstract Methods 
void applyAction​(ROOT root, A action)
This method must be defined in a subclass to get the data from the given action object and apply it to the model (root).
The method is called each step of reinforcement learning / AI test loop.
void applyConfiguration​(ROOT root, C configuration)
This method must be defined in a subclass to get the data from the given configuration object and apply it as the initial setup to the model (root).
The method is called only once per the whole model run - at the beginning.
boolean checkEpisodeStopCondition​(ROOT root)
This method may be defined in a subclass to check the additional stop condition of the Episode.
A createAction()
This method must be defined in a subclass - just to create new empty Action object
C createConfiguration()
This method must be defined in a subclass - just to create new empty Configuration object
ROOT createModel()
Is called to obtain a new pre-initialized top-level agent.
O createObservation()
This method must be defined in a subclass - just to create new empty Observation object
void getObservation​(ROOT root, O observation)
This method must be defined in a subclass to get the data from root and write it to the fields of the given observation.
The method is called each step of reinforcement learning / AI test loop.
Modifier and Type Method Description

Method Detail

createModel

ROOT createModel()
Is called to obtain a new pre-initialized top-level agent. This method must be defined in a subclass. Note that the top-level agent should just be constructed in this method, as its create() and start() methods will be called later on.
This method should not be used to define parameters
Parameters:
engine - the simulation engine that will simulate the model

createObservation

O createObservation()
This method must be defined in a subclass - just to create new empty Observation object
Returns:
new empty Observation object

createAction

A createAction()
This method must be defined in a subclass - just to create new empty Action object
Returns:
new empty Action object

createConfiguration

C createConfiguration()
This method must be defined in a subclass - just to create new empty Configuration object
Returns:
new empty Configuration object

getObservation

void getObservation​(ROOT root,
                    O observation)
This method must be defined in a subclass to get the data from root and write it to the fields of the given observation.
The method is called each step of reinforcement learning / AI test loop.
Parameters:
root - the root model agent
observation - data structure, to be filled from the simulation model and then sent to the Learning Agent (AI)

applyAction

void applyAction​(ROOT root,
                 A action)
This method must be defined in a subclass to get the data from the given action object and apply it to the model (root).
The method is called each step of reinforcement learning / AI test loop.
Parameters:
root - the root model agent
action - data structure, coming from the Learning Agent (AI) and then applied to the model

applyConfiguration

void applyConfiguration​(ROOT root,
                        C configuration)
This method must be defined in a subclass to get the data from the given configuration object and apply it as the initial setup to the model (root).
The method is called only once per the whole model run - at the beginning.
Parameters:
root - the root model agent
action - data structure, coming from the Reinforcement Learning platform and then applied to the model

checkEpisodeStopCondition

boolean checkEpisodeStopCondition​(ROOT root)
This method may be defined in a subclass to check the additional stop condition of the Episode. Should return true to request stopping the Episode (e.g. when the model falls into some undesired terminal state which doesn't allow further training or testing of Learning Agent).
Returns:
true to stop the model, false to continue learning/simulation loop
How can we improve this article?