Skip to content

AgentInterface

The agent interfaces for the BaseAgent instances.

Attributes:

Name Type Description
actions List[Action]

list of possible actions

action_space ActionSpace

ActionSpace instance

active bool

flag of active (currently performing actions) agent

agent BaseAgent

agent object instance

agent_name str

name of the agent

allowed_subnets List[str]

list of allowed subnets

file dict
group_name dict
hostname dict
interface_name dict
internal_only bool

flag for the agent being an internal only agent

last_action = None
messages list

list of messages

path dict
password dict
password_hash dict
process_name dict
scenario Scenario

current scenario instance

username = dict

Functions

__init__

__init__(agent_obj, agent_name, actions, allowed_subnets, scenario, active = True, internal_only = False)

Parameters:

Name Type Description Default
agent_obj BaseAgent
required
agent_name str
required
actions List[Action]
required
allowed_subnets List[str]
required
scenario Scenario
required
active bool
True
internal_only bool
False

create_reward_calculator

create_reward_calculator(reward_calculator: str, agent_name: str, scenario: Scenario) -> RewardCalculator

Creates a reward calculator based on the name of the calculator to be used.

Parameters:

Name Type Description Default
reward_calculator str

name of reward calculator

required
agent_name str

name of agent

required
scenario Scenario

current scenario object

required

Returns:

Type Description
RewardCalculator

created reward calculator

end_episode

end_episode()

perform agent end of episode functionality and reset the interface

get_action

get_action(observation: Observation, action_space: dict = None)

Gets an action from the agent to perform on the environment

Parameters:

Name Type Description Default
observation Observation

agent observation space

required
action_space dict

agent action space

None

Returns:

Name Type Description
last_action Action

last action performed

reset

reset()

resets the interface with empty dictionaries

set_init_obs

set_init_obs(init_obs, true_obs)

set and update the true and initial observations

update

update(obs: dict, known: bool = True)

update the action space with the observation

update_allowed_subnets

update_allowed_subnets(allowed_subnets)

Updates allowed_subnets for agent

Attributes:

Name Type Description
allowed_subnets List(str)

agent's allowed_subnets for mission phase