#2869 - Updates to address test failures. Updated YAML configs to remove redundant start_settings
This commit is contained in:
@@ -3,6 +3,7 @@ from primaite.game.agent.actions import ActionManager
|
||||
from primaite.game.agent.observations.observation_manager import NestedObservation, ObservationManager
|
||||
from primaite.game.agent.rewards import RewardFunction
|
||||
from primaite.game.agent.scripted_agents.probabilistic_agent import ProbabilisticAgent
|
||||
from primaite.game.game import PrimaiteGame
|
||||
|
||||
|
||||
def test_probabilistic_agent():
|
||||
@@ -25,36 +26,41 @@ def test_probabilistic_agent():
|
||||
MIN_NODE_FILE_DELETE = 5750
|
||||
MAX_NODE_FILE_DELETE = 6250
|
||||
|
||||
action_space = ActionManager(
|
||||
actions=[
|
||||
action_space_cfg = {
|
||||
"action_list": [
|
||||
{"type": "DONOTHING"},
|
||||
{"type": "NODE_APPLICATION_EXECUTE"},
|
||||
{"type": "NODE_FILE_DELETE"},
|
||||
],
|
||||
nodes=[
|
||||
"nodes": [
|
||||
{
|
||||
"node_name": "client_1",
|
||||
"applications": [{"application_name": "WebBrowser"}],
|
||||
"folders": [{"folder_name": "downloads", "files": [{"file_name": "cat.png"}]}],
|
||||
},
|
||||
],
|
||||
max_folders_per_node=2,
|
||||
max_files_per_folder=2,
|
||||
max_services_per_node=2,
|
||||
max_applications_per_node=2,
|
||||
max_nics_per_node=2,
|
||||
max_acl_rules=10,
|
||||
protocols=["TCP", "UDP", "ICMP"],
|
||||
ports=["HTTP", "DNS", "ARP"],
|
||||
act_map={
|
||||
"max_folders_per_node": 2,
|
||||
"max_files_per_folder": 2,
|
||||
"max_services_per_node": 2,
|
||||
"max_applications_per_node": 2,
|
||||
"max_nics_per_node": 2,
|
||||
"max_acl_rules": 10,
|
||||
"protocols": ["TCP", "UDP", "ICMP"],
|
||||
"ports": ["HTTP", "DNS", "ARP"],
|
||||
"act_map": {
|
||||
0: {"action": "DONOTHING", "options": {}},
|
||||
1: {"action": "NODE_APPLICATION_EXECUTE", "options": {"node_id": 0, "application_id": 0}},
|
||||
2: {"action": "NODE_FILE_DELETE", "options": {"node_id": 0, "folder_id": 0, "file_id": 0}},
|
||||
},
|
||||
)
|
||||
"options": {},
|
||||
}
|
||||
observation_space = ObservationManager(NestedObservation(components={}))
|
||||
reward_function = RewardFunction()
|
||||
|
||||
observation_space_cfg = None
|
||||
|
||||
reward_function_cfg = {}
|
||||
|
||||
# pa = ProbabilisticAgent(
|
||||
# agent_name="test_agent",
|
||||
# action_space=action_space,
|
||||
@@ -67,9 +73,10 @@ def test_probabilistic_agent():
|
||||
|
||||
pa_config = {
|
||||
"agent_name": "test_agent",
|
||||
"action_manager": action_space,
|
||||
"observation_manager": observation_space,
|
||||
"reward_function": reward_function,
|
||||
"game": PrimaiteGame(),
|
||||
"action_manager": action_space_cfg,
|
||||
"observation_manager": observation_space_cfg,
|
||||
"reward_function": reward_function_cfg,
|
||||
"agent_settings": {
|
||||
"action_probabilities": {0: P_DO_NOTHING, 1: P_NODE_APPLICATION_EXECUTE, 2: P_NODE_FILE_DELETE},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user