Skip to content

EnterpriseScenarioGenerator

Bases: ScenarioGenerator

This class is used to generate scenarios designed for the Cage Challenge 4 (CC4)

Attributes:

Name Type Description
background_image str

path to a background render image

used_pids List[int]
blue_agent_class BaseAgent

class instance that inherits from BaseAgent to be used in scenario for blue agents

red_agent_class BaseAgent

class instance that inherits from BaseAgent to be used in scenario for red agents

green_agent_class BaseAgent

class instance that inherits from BaseAgent to be used in scenario for green agents

steps int

number of steps that make up the episode

MIN_USER_HOSTS int

minimum number of user hosts generated in the dynamic scenario, set at 3

MAX_USER_HOSTS int

maximum number of user hosts generated in the dynamic scenario, set at 10

MIN_SERVER_HOSTS int

minimum number of server hosts generated in the dynamic scenario, set at 1

MAX_SERVER_HOSTS int

maximum number of server hosts generated in the dynamic scenario, set at 6

MAX_ADDON_SERVICES int

maximum number of add-on services generated in the dynamic scenario, set at 10

MAX_BANDWIDTH int

maximum bandwidth of communications, set at 100

MESSAGE_LENGTH int

message length of agent communications, set at 8

Functions

__init__

__init__(blue_agent_class: Type[BaseAgent] = None, red_agent_class: Type[BaseAgent] = None, green_agent_class: Type[BaseAgent] = None, steps: int = 100)

Parameters:

Name Type Description Default
blue_agent_class BaseAgent

The type of agent for blue agents, by default None

None
red_agent_class BaseAgent

The type of agent for red agents, by default None

None
green_agent_class BaseAgent

The type of agent for green agents, by default None

None
steps int

The number of steps, by default 100

100

create_scenario

create_scenario(np_random: RandomNumberGenerator) -> Scenario

This public function initiates the generation of a new Enterprise Scenario.

This function calls a multitude of private functions to generate:

  • subnets
  • hosts
  • agents (red, green, blue)
  • mission phases
  • reward machines

Finally, the outputs from all the private functions in this class are used to create an instance of the Scenario object - which is returned.

Parameters:

Name Type Description Default
np_random RandomNumberGenerator

The RNG that will be used to make "random" decisions when creating scenarios.

required

Returns:

Name Type Description
scenario Scenario

The new enterprise scenario object

determine_done

determine_done(env_controller) -> bool

Determines when the episode ends

Returns:

Type Description
Boolean

T/F value for if episode is to end