HW3: Extending an Agent
This assignment was created by Scott Douglass and/or Roman
Stanchak and very slightly adapted by A.Hornof
Due Wednesday May 5, 2004, 10pm
Email a zip file containing your Rose .mdl file, the converted Lisp
file, and any associated function files to hornof@cs.uoregon.edu
(but please do not otherwise send me email attachments). If you
implemented any functionality aside from the basics, please include a
text file describing what you did.
For homework 3 I would like you to extend Agent
3 or Agent 4 so that it employs
more complex steering behavior.
Minimally, I would like you to implement two new behaviors:
- Rotate to discover new targets when none are currently in the
field of view.
- Maintain the agent's "personal space". When other agents come
in very close contact with your agent, move away to maintain
breathing room. This can be implemented either by checking
distance or detecting collisions and moving away. (remember
classify-seperation in Agent 4?)
Some other possible behaviors you could implement include:
- Listen for sounds to find a target
- Avoid pits/walls/other environmental hazards
Here are some references:
Tips:
- If you're getting the following error when you try to convert
your agent:
Error: `nil' is not of the expected type `number'"
Make sure all the <<rule>> elements in your model
have non-empty documentation (right click > open specification
> Documentation)
- Don't use additional forks in a control structure. While the
idea is sound, the translation into Lisp has not been written to
manage this style of representation.
- Don't use additional forks in sensor, deliberator, or effector
statecharts. While the idea is sound, the translation into Lisp
has not been written to manage this style of representation.
- Never have more than 1 transition between states in a sensor,
deliberator, or effector statechart. While the idea is sound, the
translation into Lisp has not been written to manage this style of
representation.
- [removed]
- Remember, every rule needs a consequent. ie. If you wanted a
rule that just checks to see if a target is visible, do something
like this...
If guard:
(target ?t ?a)
Then action:
(target-noticed yes)
Of course, you're free to ignore the assertion in subsequent
control structure elements.
- Remember, functions are not the same thing as predicates. ie.
Don't try to assert a (func foo ?a ?b ?c ?return).
- The lisp evaluator is not used to reduce patterns. In other
words, don't try to assert something like...
Then action:
(runto-location (+ ?x 5) (+ ?y 5) ?z 1))
This will just assert into percepts a patterns with sub-lists in which all
variables have been instantiated with the values in bindings...
(runto-location (+ 200 5) (+ 105 5) 80 1))
- Don't assert a primitive predicate with an illegal arity; the
system will be deeply confused. ie. Don't assert (runto-location
?predicted-xyz-list 1), this would be a runto-location with arity
2 when the expected runto-location has arity 4.