Documentation
¶
Index ¶
- Constants
- func Add(name string, creator NewEnvironmentCreator) error
- func Create(name string, debug logger.Debug) (rlglue.Environment, error)
- func NewCartpole(logger logger.Debug) (rlglue.Environment, error)
- func NewExample(logger logger.Debug) (rlglue.Environment, error)
- func NewReplay(debug logger.Debug) (rlglue.Environment, error)
- type Cartpole
- type Example
- type NewEnvironmentCreator
- type Replay
Constants ¶
const ( ExampleActionMax = 10 ExampleStateMax = ExampleActionMax * 10 ExampleNumberOfActions = 2*ExampleActionMax + 1 )
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(name string, creator NewEnvironmentCreator) error
Add is used to register a new environment type. This is most likely called by an init function in the Environment's go file. The function returns an error if an environment with that name already exists.
func NewCartpole ¶
func NewCartpole(logger logger.Debug) (rlglue.Environment, error)
func NewExample ¶
func NewExample(logger logger.Debug) (rlglue.Environment, error)
Types ¶
type Cartpole ¶
func (*Cartpole) GetAttributes ¶
func (env *Cartpole) GetAttributes() rlglue.Attributes
GetAttributes returns attributes for this environment.
func (*Cartpole) Initialize ¶
func (env *Cartpole) Initialize(run uint, attr rlglue.Attributes) error
Initialize configures the environment with the provided parameters and resets any internal state.
type Example ¶
Example is just a dumb test environment. state is adjusted by the action. Valid values are integers [0, ExampleNumberOfActions). Reward is equal to the new state. When |state| is >= ExampleStateMax, it's reset to 0.
func (*Example) GetAttributes ¶
func (env *Example) GetAttributes() rlglue.Attributes
GetAttributes returns attributes for this environment.
func (*Example) Initialize ¶
func (env *Example) Initialize(run uint, attr rlglue.Attributes) error
Initialize configures the environment with the provided parameters and resets any internal state.
type NewEnvironmentCreator ¶
type NewEnvironmentCreator func(logger.Debug) (rlglue.Environment, error)
NewEnvironmentCreator is a function that can create an environment.
type Replay ¶
type Replay struct {
logger.Debug
logger.ReplayData
// contains filtered or unexported fields
}
Replay loads a previous data file and replays it. The previously chosen action is appended to the end of the state vector. When 'log-action-diff' is true, the environment logs errors if the same action was not chosen. The attribute "state-contains-replay" is always set to true.
func (*Replay) GetAttributes ¶
func (env *Replay) GetAttributes() rlglue.Attributes
GetAttributes returns attributes for this environment.
func (*Replay) Initialize ¶
func (env *Replay) Initialize(run uint, attr rlglue.Attributes) error
Initialize configures the environment with the provided parameters and resets any internal state.