RLPack
 
Loading...
Searching...
No Matches
rlpack.simulator.Simulator Class Reference

Simulator class simulates the environments and runs the agent through the environment. More...

Public Member Functions

def __init__ (self, Dict[str, Any] config, bool is_child_process=False)
 
None run (self, **kwargs)
 This method runs the simulator. More...
 
Agent setup_agent (self)
 This method sets up agent by loading all the necessary arguments. More...
 
List[pytorch.nn.Module] setup_models (self)
 The method sets up the models. More...
 

Data Fields

 agent
 The agent object requested via config. More...
 
 agent_model_args
 
 config
 The input config. More...
 
 env
 The environment object requested via config or passed via config. More...
 
 is_custom_model
 The flag indicating if the model is custom or not, i.e. More...
 
 sanity_check
 The object of rlpack.utils.sanity_check.SanityCheck to perform sanity checks on arguments. More...
 
 setup
 The object of rlpack.utils.setup.Setup to set-up models. More...
 

Detailed Description

Simulator class simulates the environments and runs the agent through the environment.

It also sets up the models and agents for training and/or evaluation.

Constructor & Destructor Documentation

◆ __init__()

def rlpack.simulator.Simulator.__init__ (   self,
Dict[str, Any]  config,
bool   is_child_process = False 
)
Parameters
configDict[str, Any]: The configuration dictionary for setup.
is_child_processbool: Indicates if Simulator is being run as a child process. Default: False

Member Function Documentation

◆ run()

None rlpack.simulator.Simulator.run (   self,
**  kwargs 
)

This method runs the simulator.

Parameters
kwargsAdditional keyword arguments for the training run.

◆ setup_agent()

Agent rlpack.simulator.Simulator.setup_agent (   self)

This method sets up agent by loading all the necessary arguments.

Returns
Agent: The loaded and initialized agent.

◆ setup_models()

List[pytorch.nn.Module] rlpack.simulator.Simulator.setup_models (   self)

The method sets up the models.

Depending on the requirement of the agent, returns a list of models, all of which are loaded and initialized.

Returns
List[pytorch.nn.Module]: List of models.

Field Documentation

◆ agent

rlpack.simulator.Simulator.agent

The agent object requested via config.

◆ agent_model_args

rlpack.simulator.Simulator.agent_model_args

◆ config

rlpack.simulator.Simulator.config

The input config.

◆ env

rlpack.simulator.Simulator.env

The environment object requested via config or passed via config.

◆ is_custom_model

rlpack.simulator.Simulator.is_custom_model

The flag indicating if the model is custom or not, i.e.

does not use in-built models.

◆ sanity_check

rlpack.simulator.Simulator.sanity_check

The object of rlpack.utils.sanity_check.SanityCheck to perform sanity checks on arguments.

◆ setup

rlpack.simulator.Simulator.setup

The object of rlpack.utils.setup.Setup to set-up models.