-
Notifications
You must be signed in to change notification settings - Fork 7
Using
Ngô Xuân Phong edited this page May 23, 2023
·
5 revisions
| Function | Input | Input Description | Ouput | Output Description |
|---|---|---|---|---|
| Agent | np.float64, any | state,data agent | int, any | |
| getValidActions | np.float64 | state | np.float64 | Valids Actions in current turn |
| getReward | np.float64 | state | int | 1: win, 0:lose, -1: not done |
| getActionSize | None | int | action size | |
| getStateSize | None | int | amount agent state size |
from numba import njit
import numpy as np
@njit()
def Agent(state, agent_data):
validActions = env.getValidActions(state)
actions = np.where(validActions==1)[0]
action = np.random.choice(actions)
return arr_action[idx], agent_datafrom setup import make
env = make('SushiGo')More env please read Environments
env = make('SushiGo)
count_win, agent_data = env.numba_main_2(Agent, count_game_train = 1, agent_data = [0], level = 0)| Var | Type | Description |
|---|---|---|
| count_game_train | int | matches of a environment |
| agent_data | any | data train of agent |
| level | 0, 1, -1 | level of environment (update more later) |
env.render(Agent=Agent, per_data=[0], level=0, max_temp_frame=100)
You may be interested in FAQ.
Contributions are Welcome!
Contributions are Welcome!