NASimEnv load reference

Technical reference material for different functions for creating a new NASim Environment.

nasim.make_benchmark(scenario_name, seed=None, fully_obs=False, flat_actions=True, flat_obs=True, render_mode=None)

Make a new benchmark NASim environment.

Parameters:
  • scenario_name (str) – the name of the benchmark environment
  • seed (int, optional) – random seed to use to generate environment (default=None)
  • fully_obs (bool, optional) – the observability mode of environment, if True then uses fully observable mode, otherwise partially observable (default=False)
  • flat_actions (bool, optional) – if true then uses a flat action space, otherwise will use parameterised action space (default=True).
  • flat_obs (bool, optional) – if true then uses a 1D observation space. If False will use a 2D observation space (default=True)
  • render_mode (str, optional) – The render mode to use for the environment.
Returns:

a new environment instance

Return type:

NASimEnv

Raises:

NotImplementederror – if scenario_name does no match any implemented benchmark scenarios.

nasim.load(path, fully_obs=False, flat_actions=True, flat_obs=True, name=None, render_mode=None)

Load NASim Environment from a .yaml scenario file.

Parameters:
  • path (str) – path to the .yaml scenario file
  • fully_obs (bool, optional) – The observability mode of environment, if True then uses fully observable mode, otherwise partially observable (default=False)
  • flat_actions (bool, optional) – if true then uses a flat action space, otherwise will use parameterised action space (default=True).
  • flat_obs (bool, optional) – if true then uses a 1D observation space. If False will use a 2D observation space (default=True)
  • name (str, optional) – the scenarios name, if None name will be generated from path (default=None)
  • render_mode (str, optional) – The render mode to use for the environment.
Returns:

a new environment object

Return type:

NASimEnv

nasim.generate(num_hosts, num_services, fully_obs=False, flat_actions=True, flat_obs=True, render_mode=None, **params)

Construct Environment from an auto generated network.

Parameters:
  • num_hosts (int) – number of hosts to include in network (minimum is 3)
  • num_services (int) – number of services to use in environment (minimum is 1)
  • fully_obs (bool, optional) – The observability mode of environment, if True then uses fully observable mode, otherwise partially observable (default=False)
  • flat_actions (bool, optional) – if true then uses a flat action space, otherwise will use parameterised action space (default=True).
  • flat_obs (bool, optional) – if true then uses a 1D observation space. If False will use a 2D observation space (default=True)
  • render_mode (str, optional) – The render mode to use for the environment.
  • params (dict, optional) – generator params (see ScenarioGenertor for full list)
Returns:

a new environment object

Return type:

NASimEnv