Environment object is not subscriptable

1k views Asked by At

I am following the tutorial on the web. When I tried to run the examples on the tutorials.

On tutorial 1,5,6.There are similar errors:

For tutorial 1,5: TypeError:'AccelEnv' object is not subscriptable.

For tutorial 6: TypeError:'TestEnv' object is not subscriptable.

These two environments(AcceleEnv&TestEnv) all belong to flow.envs package.

1

There are 1 answers

0
Ashkan On

Sorry for the annoyance. We recently updated the way we run the experiments (about last week). The tutorials that you see are still with the old way of running the experiments (i.e. exp = Experiment(env)).

We have a new Pull Request at https://github.com/flow-project/flow/pull/802/files which will be merged soon, to update the tutorials.

In the meantime if you want to run the tutorials, you have to define a flow_params dictionary and then run your experiment as

flow_params['env'].horizon = 100000
exp = Experiment(flow_params)
exp.env = env

# run the simulation
_ = exp.run(1)"