<jupyter_start><jupyter_text>Environment<jupyter_code># possible reward_modus 'raw', 'sqt', 'log10', 'cube'
env = BrokenComponentsEnv(broken_components, reward_modus='raw', reward_decrease=True, reward_decrease_factor=0.99, state_as_vec=True)
# env = BrokenComponentsEnv(broken_components, reward_modus='raw', reward_decrease=True, reward_decrease_factor=0.99, state_as_vec=False)<jupyter_output><empty_output><jupyter_text>Env properties<jupyter_code>n_actions = env.action_space.n
n_actions
n_states = env.observation_space.n
n_states
env.action_space_names
env.observation_space_names<jupyter_output><empty_output><jupyter_text>Examples  Example 1<jupyter_code>env.reset(reward_modus='raw') # possible reward_modus 'raw', 'sqt', 'log10', 'cubic'
env.render()

action = env.action_space.sample()
state, reward, done, _ = env.step(action)
print(state, reward, done)
env.render()

action = env.action_space.sample()
state, reward, done, _ = env.step(action)
print(state, reward, done)
env.render()

action = env.action_space.sample()
state, reward, done, _ = env.step(action)
print(state, reward, done)
env.render()<jupyter_output>Steps:  0
Action:  None
Successful:  None
State:  [('_SFDEvucdEeet0YmmfbMwkw', 'CF3'), ('_SFKZ_ecdEeet0YmmfbMwkw', 'CF2'), ('_SEyloOcdEeet0YmmfbMwkw', 'CF2'), ('_SE23gucdEeet0YmmfbMwkw', 'CF3'), ('_SFB2oOcdEeet0YmmfbMwkw', 'CF3')] 


[1. 0. 1. 1. 1.] 6.93 False
Steps:  1
Action:  ('_SFKZ_ecdEeet0YmmfbMwkw', 'CF2')
Successful:  True
State:  [('_SFDEvucdEeet0YmmfbMwkw', 'CF3'), ('_SEyloOcdEeet0YmmfbMwkw', 'CF2'), ('_SE23gucdEeet0YmmfbMwkw', 'CF3'), ('_SFB2oOcdEeet0YmmfbMwkw', 'CF3')] 


[1. 0. 1. 1. 1.] -74.97765 False
Steps:  2
Action:  ('_SFKZ_ecdEeet0YmmfbMwkw', 'CF2')
Successful:  None
State:  [('_SFDEvucdEeet0YmmfbMwkw', 'CF3'), ('_SEyloOcdEeet0YmmfbMwkw', 'CF2'), ('_SE23gucdEeet0YmmfbMwkw', 'CF3'), ('_SFB2oOcdEeet0YmmfbMwkw', 'CF3')] 


[1. 0. 1. 0. 1.] 15.524784 False
Steps:  3
Action:  ('_SE23gucdEeet0YmmfbMwkw', 'CF3')
Successful:  True
State:  [('_SFDEvucdEeet0YmmfbMwkw', 'CF3'), ('_SEyloOcdEeet0YmmfbMwkw', 'CF2'), ('_SFB2oOcdEeet0YmmfbMwkw', 'CF3')]<jupyter_text>Example 2<jupyter_code>env.reset('raw') # possible reward_modus 'raw', 'sqt', 'log10', 'cube'
accumulated_reward = 0
episode_done = False

while(not episode_done):
    action = env.action_space.sample()
    state, reward, done, _ = env.step(action)
    accumulated_reward += reward
    
    clear_output(wait=True)
    env.render()
    print('Reward: ', reward)
    time.sleep(1)
    
    
    if(done):
        print('FINISHED!')
        print('Acc Reward: ', accumulated_reward)
    episode_done = done<jupyter_output>Steps:  7
Action:  ('_SFDEvucdEeet0YmmfbMwkw', 'CF3')
Successful:  True
State:  [] 


Reward:  29.36005845907018
FINISHED!
Acc Reward:  -69.67038362745632
{'fraction_non_alphanumeric': 0.1562164098889287, 'fraction_numerical': 0.049444643496954495, 'mean_word_length': 6.405835543766578, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '466228', 'license': 'MIT', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1247, 'n_words': 195, 'path': 'rl-4-self-repair/envs/Playground_BrokenComponentsEnv.ipynb', 'repo_name': 'hpi-sam/robust-marl4sas', 'size': '2791'}