|
@ -19,14 +19,14 @@ def example_simulator_02(): |
|
|
paths = [] |
|
|
paths = [] |
|
|
for m in range(5): |
|
|
for m in range(5): |
|
|
path = [] |
|
|
path = [] |
|
|
state = simulator.restart() |
|
|
|
|
|
|
|
|
state, reward = simulator.restart() |
|
|
path = [f"{state}"] |
|
|
path = [f"{state}"] |
|
|
for n in range(20): |
|
|
for n in range(20): |
|
|
actions = simulator.available_actions() |
|
|
actions = simulator.available_actions() |
|
|
select_action = random.randint(0,len(actions)-1) |
|
|
select_action = random.randint(0,len(actions)-1) |
|
|
#print(f"Randomly select action nr: {select_action} from actions {actions}") |
|
|
#print(f"Randomly select action nr: {select_action} from actions {actions}") |
|
|
path.append(f"--act={actions[select_action]}-->") |
|
|
path.append(f"--act={actions[select_action]}-->") |
|
|
state = simulator.step(actions[select_action]) |
|
|
|
|
|
|
|
|
state, reward = simulator.step(actions[select_action]) |
|
|
#print(state) |
|
|
#print(state) |
|
|
path.append(f"{state}") |
|
|
path.append(f"{state}") |
|
|
if simulator.is_done(): |
|
|
if simulator.is_done(): |
|
@ -48,14 +48,14 @@ def example_simulator_02(): |
|
|
paths = [] |
|
|
paths = [] |
|
|
for m in range(5): |
|
|
for m in range(5): |
|
|
path = [] |
|
|
path = [] |
|
|
state = simulator.restart() |
|
|
|
|
|
|
|
|
state, reward = simulator.restart() |
|
|
path = [f"{state}"] |
|
|
path = [f"{state}"] |
|
|
for n in range(20): |
|
|
for n in range(20): |
|
|
actions = simulator.available_actions() |
|
|
actions = simulator.available_actions() |
|
|
select_action = random.randint(0,len(actions)-1) |
|
|
select_action = random.randint(0,len(actions)-1) |
|
|
#print(f"Randomly select action nr: {select_action} from actions {actions}") |
|
|
#print(f"Randomly select action nr: {select_action} from actions {actions}") |
|
|
path.append(f"--act={actions[select_action]}-->") |
|
|
path.append(f"--act={actions[select_action]}-->") |
|
|
state = simulator.step(actions[select_action]) |
|
|
|
|
|
|
|
|
state, reward = simulator.step(actions[select_action]) |
|
|
#print(state) |
|
|
#print(state) |
|
|
path.append(f"{state}") |
|
|
path.append(f"{state}") |
|
|
if simulator.is_done(): |
|
|
if simulator.is_done(): |
|
|