-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed pathfinding issue. planning untested. added tutorial
- Loading branch information
Showing
7 changed files
with
72 additions
and
24 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from pygoap.actions import * | ||
from pygoap.goals import * | ||
|
||
from pygoap.agent import GoapAgent | ||
from pygoap.environment import Environment | ||
|
||
|
||
class PrintActionContext(CalledOnceContext): | ||
def enter(self): | ||
print "hello world" | ||
|
||
class PrintAction(ActionBuilder): | ||
def get_actions(self, caller, memory): | ||
action = PrintActionContext(caller) | ||
action.effects.append(SimpleGoal(introduced_self=True)) | ||
yield action | ||
|
||
|
||
|
||
agent = GoapAgent() | ||
agent.add_action(PrintAction()) | ||
|
||
friendly_goal = SimpleGoal(introduced_self=True) | ||
agent.add_goal(friendly_goal) | ||
|
||
env = Environment() | ||
env.add(agent) | ||
|
||
env.update(1) | ||
|
||
|