-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from CarperAI/release
Small fixes
- Loading branch information
Showing
10 changed files
with
175 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
"""Manual test for creating learning curriculum manually""" | ||
# pylint: disable=invalid-name,redefined-outer-name,bad-builtin | ||
# pylint: disable=wildcard-import,unused-wildcard-import | ||
from typing import List | ||
|
||
from nmmo.task import constraint as c | ||
from nmmo.task.base_predicates import AttainSkill, CountEvent, EarnGold, TickGE | ||
from nmmo.task.task_spec import TaskSpec | ||
|
||
curriculum: List[TaskSpec] = [] | ||
|
||
# Stay alive as long as possible | ||
curriculum.append( | ||
TaskSpec(eval_fn=TickGE, eval_fn_kwargs={"num_tick": 1024}) | ||
) | ||
|
||
# Perform these 10 times | ||
essential_skills = [ | ||
"EAT_FOOD", | ||
"DRINK_WATER", | ||
"SCORE_HIT", | ||
"PLAYER_KILL", | ||
"HARVEST_ITEM", | ||
"EQUIP_ITEM", | ||
"CONSUME_ITEM", | ||
"LEVEL_UP", | ||
"EARN_GOLD", | ||
"LIST_ITEM", | ||
"BUY_ITEM", | ||
"GIVE_ITEM", | ||
"DESTROY_ITEM", | ||
"GIVE_GOLD", | ||
] | ||
for event_code in essential_skills: | ||
curriculum.append( | ||
TaskSpec( | ||
eval_fn=CountEvent, | ||
eval_fn_kwargs={"event": event_code, "N": 10}, | ||
) | ||
) | ||
|
||
# Reach skill level 10 | ||
for skill in c.combat_skills + c.harvest_skills: | ||
curriculum.append( | ||
TaskSpec( | ||
eval_fn=AttainSkill, | ||
eval_fn_kwargs={"skill": skill, "level": 10, "num_agent": 1}, | ||
) | ||
) | ||
|
||
# Earn gold 50 | ||
curriculum.append( | ||
TaskSpec(eval_fn=EarnGold, eval_fn_kwargs={"amount": 50}) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.