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 |
get_action
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 |