Environments

arch_gym.envs.AstraSimEnv module

class arch_gym.envs.AstraSimEnv.AstraSimEnv(rl_form='random_walker', max_steps=5, num_agents=1, reward_formulation='None', reward_scaling=1)[source]

Bases: Env

action_space: Space[ActType]
calculate_reward(observations)[source]
close()[source]

Override close in your subclass to perform any necessary cleanup.

Environments will automatically close() themselves when garbage collected or when the program exits.

observation_space: Space[ObsType]
parse_result(file_name)[source]
render()[source]

Compute the render frames as specified by render_mode attribute during initialization of the environment.

The set of supported modes varies per environment. (And some third-party environments may not support rendering at all.) By convention, if render_mode is:

  • None (default): no render is computed.

  • human: render return None. The environment is continuously rendered in the current display or terminal. Usually for human consumption.

  • rgb_array: return a single frame representing the current state of the environment. A frame is a numpy.ndarray with shape (x, y, 3) representing RGB values for an x-by-y pixel image.

  • rgb_array_list: return a list of frames representing the states of the environment since the last reset. Each frame is a numpy.ndarray with shape (x, y, 3), as with rgb_array.

  • ansi: Return a strings (str) or StringIO.StringIO containing a terminal-style text representation for each time step. The text can include newlines and ANSI escape sequences (e.g. for colors).

Note

Make sure that your class’s metadata ‘render_modes’ key includes the list of supported modes. It’s recommended to call super() in implementations to use the functionality of this method.

reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

seed()[source]
step(action_dict)[source]

Step function for the environment

arch_gym.envs.AstraSimWrapper module

arch_gym.envs.DRAMEnv module

class arch_gym.envs.DRAMEnv.DRAMEnv(reward_formulation='power', cost_model='simulator')[source]

Bases: Env

actionToConfigs(action)[source]

Converts actions output from the agent to update the configuration files.

action_space: Space[ActType]
calculate_reward(power, latency)[source]
get_observation(outstream)[source]

converts the std out from DRAMSys to observation of energy, power, latency [Energy (PJ), Power (mW), Latency (ns)]

obs_to_dict(obs)[source]
observation_space: Space[ObsType]
reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

runDRAMEnv()[source]

Method to launch the DRAM executables given an action

step(action_dict)[source]

Step method takes action as input and outputs observation rewards

arch_gym.envs.DRAMEnv_RL module

arch_gym.envs.FARSIEnv module

arch_gym.envs.FARSI_sim_env module

arch_gym.envs.FARSI_sim_wrapper module

arch_gym.envs.MasteroEnv module

class arch_gym.envs.MasteroEnv.MasteroEnv(rl_form: str = 'tdm', rl_algo: str = 'ppo', max_steps: int = 100, num_agents: int = 1, reward_formulation: str = 'latency', reward_scaling: str = 'false', mapping_file: str = 'mapping.csv', workload: str = 'resnet18', layer_id: int = 2, noc_bw: int = 1073741824, offchip_bw: int = 1073741824, l1_size: int = 1073741824, l2_size: int = 1073741824, num_pe: int = 1024)[source]

Bases: Env

action_space: Space[ActType]
calculate_reward(stats)[source]
clean_sim_files(file_path)[source]
observation_space: Space[ObsType]
reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

step(action)[source]

Run one timestep of the environment’s dynamics.

When end of episode is reached, you are responsible for calling reset() to reset this environment’s state. Accepts an action and returns either a tuple (observation, reward, terminated, truncated, info).

Parameters:

action (ActType) – an action provided by the agent

Returns:

this will be an element of the environment’s observation_space.

This may, for instance, be a numpy array containing the positions and velocities of certain objects.

reward (float): The amount of reward returned as a result of taking the action. terminated (bool): whether a terminal state (as defined under the MDP of the task) is reached.

In this case further step() calls could return undefined results.

truncated (bool): whether a truncation condition outside the scope of the MDP is satisfied.

Typically a timelimit, but could also be used to indicate agent physically going out of bounds. Can be used to end the episode prematurely before a terminal state is reached.

info (dictionary): info contains auxiliary diagnostic information (helpful for debugging, learning, and logging).

This might, for instance, contain: metrics that describe the agent’s performance state, variables that are hidden from observations, or individual reward terms that are combined to produce the total reward. It also can contain information that distinguishes truncation and termination, however this is deprecated in favour of returning two booleans, and will be removed in a future version.

(deprecated) done (bool): A boolean value for if the episode has ended, in which case further step() calls will return undefined results.

A done signal may be emitted for different reasons: Maybe the task underlying the environment was solved successfully, a certain timelimit was exceeded, or the physics simulation has entered an invalid state.

Return type:

observation (object)

arch_gym.envs.RandomParameterEnv module

class arch_gym.envs.RandomParameterEnv.RandomParameterEnv(natural=False)[source]

Bases: Env

action_space: Space[ActType]
compute_reward()[source]
observation_space: Space[ObsType]
random_walk(p1, p2)[source]
render()[source]

Compute the render frames as specified by render_mode attribute during initialization of the environment.

The set of supported modes varies per environment. (And some third-party environments may not support rendering at all.) By convention, if render_mode is:

  • None (default): no render is computed.

  • human: render return None. The environment is continuously rendered in the current display or terminal. Usually for human consumption.

  • rgb_array: return a single frame representing the current state of the environment. A frame is a numpy.ndarray with shape (x, y, 3) representing RGB values for an x-by-y pixel image.

  • rgb_array_list: return a list of frames representing the states of the environment since the last reset. Each frame is a numpy.ndarray with shape (x, y, 3), as with rgb_array.

  • ansi: Return a strings (str) or StringIO.StringIO containing a terminal-style text representation for each time step. The text can include newlines and ANSI escape sequences (e.g. for colors).

Note

Make sure that your class’s metadata ‘render_modes’ key includes the list of supported modes. It’s recommended to call super() in implementations to use the functionality of this method.

reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

step(action)[source]

Step function for the environment

arch_gym.envs.SniperEnv module

class arch_gym.envs.SniperEnv.SniperEnv[source]

Bases: Env

actionToConfigs(action, cfg)[source]

Converts actions output from the agent to update the configuration files

action_space: Space[ActType]
calculate_reward(obs)[source]

Calculates the reward based on the current observation

create_callback(output_dir)[source]
dict_to_obs(obs_dict)[source]
observation_space: Space[ObsType]
reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

reset_multiagent()[source]
runSniper()[source]
runSniperBatch(num_agents)[source]

Runs the sniper in batch mode

step(action)[source]

Run one timestep of the environment’s dynamics.

When end of episode is reached, you are responsible for calling reset() to reset this environment’s state. Accepts an action and returns either a tuple (observation, reward, terminated, truncated, info).

Parameters:

action (ActType) – an action provided by the agent

Returns:

this will be an element of the environment’s observation_space.

This may, for instance, be a numpy array containing the positions and velocities of certain objects.

reward (float): The amount of reward returned as a result of taking the action. terminated (bool): whether a terminal state (as defined under the MDP of the task) is reached.

In this case further step() calls could return undefined results.

truncated (bool): whether a truncation condition outside the scope of the MDP is satisfied.

Typically a timelimit, but could also be used to indicate agent physically going out of bounds. Can be used to end the episode prematurely before a terminal state is reached.

info (dictionary): info contains auxiliary diagnostic information (helpful for debugging, learning, and logging).

This might, for instance, contain: metrics that describe the agent’s performance state, variables that are hidden from observations, or individual reward terms that are combined to produce the total reward. It also can contain information that distinguishes truncation and termination, however this is deprecated in favour of returning two booleans, and will be removed in a future version.

(deprecated) done (bool): A boolean value for if the episode has ended, in which case further step() calls will return undefined results.

A done signal may be emitted for different reasons: Maybe the task underlying the environment was solved successfully, a certain timelimit was exceeded, or the physics simulation has entered an invalid state.

Return type:

observation (object)

step_multiagent(actions)[source]
  1. Take actions from all agents.

  2. Launch a batch jobs for each agent

  3. Wait for all jobs to finish

  4. return the observation, reward, done, info for each agent

arch_gym.envs.TimeloopEnv module

class arch_gym.envs.TimeloopEnv.TimeloopEnv(script_dir=None, output_dir=None, arch_dir=None, mapper_dir=None, workload_dir=None, target_val=None, num_cores=None, reward_formulation=None)[source]

Bases: Env

action_space: Space[ActType]
calculate_reward(obs)[source]

Calculates the reward based on the current observation

observation_space: Space[ObsType]
reset()[source]

Reset the environment and associated variables

reset_multiagent()[source]

Resets the multi-agent environment and associated variables

run_timeloop(arch_params)[source]

Invokes the timeloop scripts

run_timeloop_batch(multi_arch_params)[source]

Invokes the timeloop scripts in batch mode for all agents

step(action_params)[source]

Take an action in a timestep

step_multiagent(action_params)[source]

Take one action for multiple agents in each timestep

arch_gym.envs.TimeloopEnv_RL module

arch_gym.envs.archgym_env module

class arch_gym.envs.archgym_env.ArchGymEnv[source]

Bases: Env

action_space: Space[ActType]
computeReward()[source]
getGoal()[source]
observation_space: Space[ObsType]

arch_gym.envs.custom_env module

class arch_gym.envs.custom_env.CustomEnv(max_steps=10)[source]

Bases: Env

action_space: Space[ActType]
observation_space: Space[ObsType]
render(mode='human')[source]

Compute the render frames as specified by render_mode attribute during initialization of the environment.

The set of supported modes varies per environment. (And some third-party environments may not support rendering at all.) By convention, if render_mode is:

  • None (default): no render is computed.

  • human: render return None. The environment is continuously rendered in the current display or terminal. Usually for human consumption.

  • rgb_array: return a single frame representing the current state of the environment. A frame is a numpy.ndarray with shape (x, y, 3) representing RGB values for an x-by-y pixel image.

  • rgb_array_list: return a list of frames representing the states of the environment since the last reset. Each frame is a numpy.ndarray with shape (x, y, 3), as with rgb_array.

  • ansi: Return a strings (str) or StringIO.StringIO containing a terminal-style text representation for each time step. The text can include newlines and ANSI escape sequences (e.g. for colors).

Note

Make sure that your class’s metadata ‘render_modes’ key includes the list of supported modes. It’s recommended to call super() in implementations to use the functionality of this method.

reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

step(action)[source]

Run one timestep of the environment’s dynamics.

When end of episode is reached, you are responsible for calling reset() to reset this environment’s state. Accepts an action and returns either a tuple (observation, reward, terminated, truncated, info).

Parameters:

action (ActType) – an action provided by the agent

Returns:

this will be an element of the environment’s observation_space.

This may, for instance, be a numpy array containing the positions and velocities of certain objects.

reward (float): The amount of reward returned as a result of taking the action. terminated (bool): whether a terminal state (as defined under the MDP of the task) is reached.

In this case further step() calls could return undefined results.

truncated (bool): whether a truncation condition outside the scope of the MDP is satisfied.

Typically a timelimit, but could also be used to indicate agent physically going out of bounds. Can be used to end the episode prematurely before a terminal state is reached.

info (dictionary): info contains auxiliary diagnostic information (helpful for debugging, learning, and logging).

This might, for instance, contain: metrics that describe the agent’s performance state, variables that are hidden from observations, or individual reward terms that are combined to produce the total reward. It also can contain information that distinguishes truncation and termination, however this is deprecated in favour of returning two booleans, and will be removed in a future version.

(deprecated) done (bool): A boolean value for if the episode has ended, in which case further step() calls will return undefined results.

A done signal may be emitted for different reasons: Maybe the task underlying the environment was solved successfully, a certain timelimit was exceeded, or the physics simulation has entered an invalid state.

Return type:

observation (object)

arch_gym.envs.custom_env_2 module

arch_gym.envs.custom_gym module

class arch_gym.envs.custom_gym.ExampleEnv[source]

Bases: Env

action_space: Space[ActType]
observation_space: Space[ObsType]
render(mode='human')[source]

Compute the render frames as specified by render_mode attribute during initialization of the environment.

The set of supported modes varies per environment. (And some third-party environments may not support rendering at all.) By convention, if render_mode is:

  • None (default): no render is computed.

  • human: render return None. The environment is continuously rendered in the current display or terminal. Usually for human consumption.

  • rgb_array: return a single frame representing the current state of the environment. A frame is a numpy.ndarray with shape (x, y, 3) representing RGB values for an x-by-y pixel image.

  • rgb_array_list: return a list of frames representing the states of the environment since the last reset. Each frame is a numpy.ndarray with shape (x, y, 3), as with rgb_array.

  • ansi: Return a strings (str) or StringIO.StringIO containing a terminal-style text representation for each time step. The text can include newlines and ANSI escape sequences (e.g. for colors).

Note

Make sure that your class’s metadata ‘render_modes’ key includes the list of supported modes. It’s recommended to call super() in implementations to use the functionality of this method.

reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

step(action)[source]

Step function for the environment

arch_gym.envs.customenv_wrapper module

arch_gym.envs.dramsys_wrapper module

arch_gym.envs.dramsys_wrapper_rl module

arch_gym.envs.envHelpers module

class arch_gym.envs.envHelpers.CustomListDumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)[source]

Bases: Dumper

increase_indent(flow=False, *args, **kwargs)[source]
class arch_gym.envs.envHelpers.helpers[source]

Bases: object

action_decoder_FARSI(action_encoded, encoding_dictionary)[source]
action_decoder_ga(act_encoded)[source]
action_decoder_ga_astraSim(act_encoded)[source]

“scheduling-policy”: {“FIFO”, “LIFO”}, “collective-optimization”: {“localBWAware”, “baseline”}, “intra-dimension-scheduling”: {“FIFO”, “SCF”}, “inter-dimension-scheduling”: {“baseline”, “themis”}

action_decoder_rl(act_encoded, rl_form)[source]

Decode the action space for the RL agent

action_mapper(action, param)[source]

RL agent outputs actions in [0,1]

This function maps the action space to the actual values we split the action space (0,1) into equal parts depending on the number of valid actions each parameter can take We then bin the action to the appropriate range

action_mapper_FARSI(action, encoding_dictionary)[source]
action_mapper_timeloop(action, param)[source]

RL agent outputs actions in [0,1] This function maps the action space to the actual values we split the action space (0,1) into equal parts depending on the number of valid actions each parameter can take We then bin the action to the appropriate range

compute_area_maestro(num_pe, l1_size, l2_size)[source]
create_agent_configs(agent_ids, cfg)[source]
create_timeloop_dirs(agent_id, base_script_dir, base_output_dir, base_arch_dir)[source]

Creates the script, output and arch directories for a given agent_id for timeloop

custom_list_representer(dumper, data)[source]
decode_action_list(action)[source]
decode_action_list_multiagent(action_list)[source]
decode_action_list_rl(action_list, dimensions)[source]

Convert the continuous action list to a discrete action list depending upon the dimensions of the network layer

decode_cluster(idx)[source]
decode_timeloop_action(action)[source]

Transforms action indexes to action dictionary yaml accepted by timeloop

extract_encoding_from_flattened_encoding(encoding_dictionary)[source]
gen_SOC_design_space(env, design_space_mode, **kwargs)[source]
gen_SOC_encoding(env, DS, design_space_mode='comprehensive', **kwargs)[source]
generate_aco_maestro_config(yaml_file, params_dict)[source]
generate_maestro_parameter_set(dimensions)[source]
get_CONVtypeShape(dimensions, CONVtype=1)[source]
get_dimensions(workload, layer_id)[source]
get_out_repr(x)[source]
map_to_discrete(action_list, discrete_values)[source]
random_walk()[source]

configurations are ordered in this fashion

keys = [“PagePolicy”, “Scheduler”, “SchedulerBuffer”, “RequestBufferSize”, “CmdMux”, “RespQueue”, “RefreshPolicy”, “RefreshMaxPostponed”, “RefreshMaxPulledin”, “PowerDownPolicy”, “Arbiter”, “MaxActiveTransactions” ]

random_walk_FARSI(env)[source]
random_walk_FARSI_array_style(env, encoding_dictionary, check_system=False)[source]
random_walk_FARSI_array_style_old(encoding_dictionary)[source]
read_modify_write_dramsys(action)[source]
read_modify_write_sniper_config(action_dict, cfg)[source]
remove_dirs(dirs)[source]

Removes a list of paths

reset()[source]
run_maestro(exe, m_file, arch_configs)[source]
run_system_checks(env, encoding_dictionary, pe_allocation, mem_allocation, bus_allocation, pe_to_bus_connection, bus_to_bus_connection, bus_to_mem_connection, task_to_pe_mapping, task_to_mem_mapping)[source]
transform_pow_2(value)[source]
write_maestro(indv=None, workload=None, layer_id=0, m_file=None)[source]
writemem_ctrlr(action_dict)[source]

arch_gym.envs.envlogger_reader_test module

arch_gym.envs.envlogger_writer_test module

arch_gym.envs.loggers module

arch_gym.envs.loggers.write_csv(path, data)[source]

arch_gym.envs.maestero_wrapper module

arch_gym.envs.simpleEnv module

class arch_gym.envs.simpleEnv.simpleEnv[source]

Bases: Env

LF_MIN = 1
RT_MAX = 10
action_space: Space[ActType]
max_steps = 10
metadata: Dict[str, Any] = {'render.modes': ['human']}
move_left = 0
move_right = 1
observation_space: Space[ObsType]
reset()[source]

Resets the environment to an initial state and returns the initial observation.

This method can reset the environment’s random number generator(s) if seed is an integer or if the environment has not yet initialized a random number generator. If the environment already has a random number generator and reset() is called with seed=None, the RNG should not be reset. Moreover, reset() should (in the typical use case) be called with an integer seed right after initialization and then never again.

Parameters:
  • seed (optional int) – The seed that is used to initialize the environment’s PRNG. If the environment does not already have a PRNG and seed=None (the default option) is passed, a seed will be chosen from some source of entropy (e.g. timestamp or /dev/urandom). However, if the environment already has a PRNG and seed=None is passed, the PRNG will not be reset. If you pass an integer, the PRNG will be reset even if it already exists. Usually, you want to pass an integer right after the environment has been initialized and then never again. Please refer to the minimal example above to see this paradigm in action.

  • options (optional dict) – Additional information to specify how the environment is reset (optional, depending on the specific environment)

Returns:

Observation of the initial state. This will be an element of observation_space

(typically a numpy array) and is analogous to the observation returned by step().

info (dictionary): This dictionary contains auxiliary information complementing observation. It should be analogous to

the info returned by step().

Return type:

observation (object)

reward_away = -2
reward_goal = 10
reward_step = -1
step(action)[source]

Step function for the environment

arch_gym.envs.sniperenv_wrapper module

arch_gym.envs.test_RandomParameterEnv module

arch_gym.envs.timeloop_acme_wrapper module

arch_gym.envs.timeloop_acme_wrapper_rl module

Module contents