Skip to content

Commit

Permalink
changes for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bitcraft committed Apr 24, 2013
1 parent 30c73b1 commit 9915458
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions npc/pirate/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The module must contain a list called "exported_actions". This list should
contain any classes that you would like to add to the planner.
To make it convienent, I have chosen to add the class to the list after each
To make it convenient, I have chosen to add the class to the list after each
declaration, although you may choose another way.
"""

Expand Down Expand Up @@ -80,7 +80,7 @@ class move_to_entity(ActionBuilder):
"""

def get_actions(self, caller, memory):
here = get_position(caller, memory)
here = get_position(caller, memory)
visited = []

for pct in memory.of_class(PositionPrecept):
Expand Down Expand Up @@ -109,7 +109,7 @@ def get_actions(self, caller, memory):
if here == pct.position and pct.entity is not caller:
action = PickupAction(caller)
action.effects.append(HasItemGoal(pct.entity))
yield action
yield action

exported_actions.append(pickup)

Expand Down
2 changes: 1 addition & 1 deletion pygoap/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def replan(self):
s = [ g for g in s if g[0] > 0.0 ]
s.sort(reverse=True)

debug("[agent] %s goals %s", self, s)
debug("[agent] %s has goals %s", self, s)

start_action = NullAction

Expand Down
12 changes: 6 additions & 6 deletions pygoap/blackboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ class MemoryManager(set):
"""
Store and manage precepts.
shared blackboards violate reality in that multiple agents share the same
thoughts, to extend the metaphore. but, the advantage of this is that in
Shared blackboards violate reality in that multiple agents share the same
thoughts, to extend the metaphor. But, the advantage of this is that in
a real-time simulation, it gives the player the impression that the agents
are able to collobroate in some meaningful way, without a significant
impact in performace.
are able to collaborate in some meaningful way, without a significant
impact in performance.
that being said, i have chosen to restrict blackboards to a per-agent
basis. this library is meant for rpgs, where the action isn't real-time
That being said, i have chosen to restrict blackboards to a per-agent
basis. This library is meant for RPGs, where the action isn't real-time
and would require a more realistic simulation of intelligence.
"""

Expand Down
13 changes: 7 additions & 6 deletions pygoap/goals.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
planning. Goals are known to the agent and are constantly monitored and
evaluated. The agent will attempt to choose the most relevant goal for it's
state (determined by the blackboard) and then the planner will determine a
plan for the agent to follw that will (possibly) satisfy the chosen goal.
plan for the agent to follow that will (possibly) satisfy the chosen goal.
See the modules effects.py and goals.py to see how these are used.
Expand All @@ -15,6 +15,7 @@
"""

from memory import MemoryManager
from environment2d import distance
from precepts import *
import sys, logging

Expand Down Expand Up @@ -186,13 +187,13 @@ class PositionGoal(GoalBase):

def test(self, memory):
"""
search memory for last known position of the target if target is not
in agent's memory return 0.0.
search memory for last known position of the target
if target is not in agent's memory then return 0.0.
do pathfinding and determine if the target is accessable
- if not return 0.0
do pathfinding and determine if the target is accessible
if not return 0.0
determine the distance required to travel to the target
Determine the distance required to travel to the target
return 1.0 if the target is reachable
"""

Expand Down

0 comments on commit 9915458

Please sign in to comment.