State¶
-
class
nasim.envs.state.
State
(network_tensor, host_num_map)¶ A state in the NASim Environment.
Each row in the state tensor represents the state of a single host on the network. For details on host the state a single host is represented see
HostVector
…
-
tensor
¶ tensor representation of the state of network
Type: numpy.Array
-
host_num_map
¶ mapping from host address to host number (this is used to map host address to host row in the network tensor)
Type: dict
-
__init__
(network_tensor, host_num_map)¶ Parameters: - state_tensor (np.Array) – the tensor representation of the network state
- host_num_map (dict) – mapping from host address to host number (this is used to map host address to host row in the network tensor)
-
get_initial_observation
(fully_obs)¶ Get the initial observation of network.
Returns: an observation object Return type: Observation
-
get_observation
(action, action_result, fully_obs)¶ Get observation given last action and action result
Parameters: - action (Action) – last action performed
- action_result (ActionResult) – observation from performing action
- fully_obs (bool) – whether problem is fully observable or not
Returns: an observation object
Return type:
-
classmethod
reset
()¶ Reset any class attributes for state
-