yawning_titan.envs.generic.core.blue_interface#

Classes

BlueInterface

The interface used by the Blue Agents to act within the environment.

class yawning_titan.envs.generic.core.blue_interface.BlueInterface(network_interface)[source]#

The interface used by the Blue Agents to act within the environment.

Initialise the blue interface.

Parameters:

network_interface – Object from the NetworkInterface class

__init__(network_interface)[source]#

Initialise the blue interface.

Parameters:

network_interface – Object from the NetworkInterface class

perform_action(action)[source]#

Perform an action within the environment.

Takes in an action number and then maps this to the correct action to perform. There are 3 different item_types of actions:

  • standard actions

  • deceptive actions

  • global actions

–standard actions– Standard actions are actions that can apply to all nodes. For each standard action there are n actions (where n is the number of nodes in the network). An example of this action would be to isolate a node. The agent has to pick the isolate action and then the node it is being applied to.

–deceptive actions– Actions relating to deceptive nodes. Since the number of deceptive actions relate to the edges not the nodes (see deceptive nodes for more info), the deceptive actions cannot come under the standard actions. An example would be to place a deceptive node. The deceptive nodes can only be placed on an edge so the agent has to pick the “place deceptive node” action and then the edge to place it on.

–global actions– Global actions are actions where the agent does not need to pick any sub action other than the action. For example an action that applies to all nodes so the agent does not need to pick a specific node to apply the action to. “Do nothing” is an example of a global action as there is no secondary choice to be made.

The function also maps any actions outside of the action space to the “do nothing” action.

Order of operations: 1- check if the action is inside the action space –> perform “do nothing” 2- check if the action is a deceptive action –> perform action 3- check if the action is a global action –> perform action 4- perform the standard action

Parameters:

action – the action to perform

Returns:

The action that has been taken The node the action was performed on

get_number_of_actions()[source]#

Get the number of actions that this blue agent can perform.

There are three item_types of actions:
  • global actions (apply to all nodes) - need 1 action space

  • deceptive actions (Add new nodes to environment)

  • standard actions (apply to a single node) - need 2 action space (action and node to perform on)

Returns:

The number of actions that this agent can perform