gflownet.envs.dummy
Base class for dummy environments: identical to the Constant environment, except that the state is ignored to check whether the environment is at the source. This means that the state might be different to the state passed at initialization, which may be useful in certain scenarios, such as conditional environments.
Classes
Dummy environment. |
Module Contents
- class gflownet.envs.dummy.Dummy(state=None, **kwargs)[source]
Bases:
gflownet.envs.constant.ConstantDummy environment.
The state might be None, in which the state will be set to [0].
states2policy, states2proxy, states2readable and readable2state are not implemented in this meta-class. Depending on the state, the default methods may work or not.
- Parameters:
state (Any)
- state
The state which will be set as constant, that is as source and final state.
- Type:
list, dict, tensor, array
- is_source(state=None)[source]
Returns True if the environment’s state or the state passed as parameter (if not None) is the source state of the environment.
This method is overriden to completely ignore the state. If the environment is done, then the environment is not at the source, and vice versa.
- Parameters:
state (list or tensor or None) – Ignored.
- Returns:
bool – Whether the environment is done (False) or not (True).
- Return type:
bool