-
Notifications
You must be signed in to change notification settings - Fork 19
/
no_agent_demo.py
37 lines (29 loc) · 1.34 KB
/
no_agent_demo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Author: Minh Hua
# Date: 11/25/2023
# Purpose: A demo with no agent so the environment will just randomly sample actions.
import os
import logging
logging.basicConfig(level=logging.INFO)
from sample_agent import ScriptedAgent
from pycmo.configs.config import get_config
from pycmo.env.cmo_env import CMOEnv
from pycmo.lib.protocol import SteamClientProps
from pycmo.lib.run_loop import run_loop_steam
config = get_config()
# MAIN LOOP
scenario_name = "floridistan"
player_side = "BLUE"
scenario_script_folder_name = "floridistan" # name of folder containing the lua script that the agent will use
command_version = config["command_mo_version"]
observation_path = os.path.join(config['steam_observation_folder_path'], f'{scenario_name}.inst')
action_path = os.path.join(config["scripts_path"], scenario_script_folder_name, "agent_action.lua")
scen_ended_path = os.path.join(config['steam_observation_folder_path'], f'{scenario_name}_scen_has_ended.inst')
steam_client_props = SteamClientProps(scenario_name=scenario_name, agent_action_filename=action_path, command_version=command_version)
cmo_env = CMOEnv(
player_side=player_side,
steam_client_props=steam_client_props,
observation_path=observation_path,
action_path=action_path,
scen_ended_path=scen_ended_path,
)
run_loop_steam(env=cmo_env, agent=None, max_steps=50)