|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.cs.dennisc.pattern.DefaultReleasable
edu.cmu.cs.dennisc.pattern.AbstractElement
edu.cmu.cs.dennisc.pattern.DefaultInstancePropertyOwner
org.alice.apis.moveandturn.Element
org.alice.apis.moveandturn.Composite
org.alice.apis.moveandturn.AbstractTransformable
org.alice.apis.moveandturn.Transformable
org.alice.apis.moveandturn.Model
org.alice.apis.moveandturn.PolygonalModel
org.alice.apis.moveandturn.gallery.GalleryModel
org.alice.apis.moveandturn.gallery.scifi.KoalaRobot
alice.kareltherobot.UrRobot
alice.kareltherobot.Robot
alice.kareltherobot.WallFollower
public class WallFollower
A robot that follows a wall using the right-hand rule and thus escapes from a maze that has no traps (a connected maze).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.alice.apis.moveandturn.gallery.scifi.KoalaRobot |
---|
org.alice.apis.moveandturn.gallery.scifi.KoalaRobot.Part |
Field Summary |
---|
Fields inherited from class org.alice.apis.moveandturn.gallery.GalleryModel |
---|
MODELED_BY_CREDIT_PROPERTY, PAINTED_BY_CREDIT_PROPERTY, PROGRAMMED_BY_CREDIT_PROPERTY |
Fields inherited from class org.alice.apis.moveandturn.PolygonalModel |
---|
POLYGONS_PROPERTY |
Fields inherited from class org.alice.apis.moveandturn.Model |
---|
COLOR_PROPERTY, FILLING_STYLE_PROPERTY, IS_BOUNDING_BOX_SHOWING_PROPERTY, IS_BOUNDING_SPHERE_SHOWING_PROPERTY, IS_SHOWING_PROPERTY, OPACITY_PROPERTY, POTENTIAL_SURFACE_TEXTURES_PROPERTY, SHADING_STYLE_PROPERTY, SURFACE_TEXTURE_PROPERTY, VISUAL_SCALE_PROPERTY |
Fields inherited from class org.alice.apis.moveandturn.Transformable |
---|
DEFAULT_ORIGIN_INCLUSION_POLICY, DEFAULT_RESIZE_POLICY, DEFAULT_SET_SIZE_POLICY |
Fields inherited from class org.alice.apis.moveandturn.AbstractTransformable |
---|
LOCAL_POINT_OF_VIEW_PROPERTY |
Fields inherited from class org.alice.apis.moveandturn.Composite |
---|
COMPONENTS_PROPERTY, DEFAULT_DURATION, DEFAULT_HOW_MUCH, DEFAULT_SPEED_STYLE, DEFAULT_STYLE, RIGHT_NOW |
Fields inherited from class org.alice.apis.moveandturn.Element |
---|
NAME_PROPERTY |
Constructor Summary | |
---|---|
WallFollower(int street,
int avenue,
alice.kareltherobot.Direction direction)
Create a robot on a specific street and avenue, facing a given direction with no beepers. |
|
WallFollower(int street,
int avenue,
alice.kareltherobot.Direction direction,
int beepers)
Create a robot on a specific street and avenue, facing a given direction with a given number of beepers. |
|
WallFollower(int street,
int avenue,
alice.kareltherobot.Direction direction,
int beepers,
org.alice.apis.moveandturn.Color color)
Create a robot on a specific street and avenue, facing a given direction with a given number of beepers and a given body color. |
Method Summary | |
---|---|
void |
followWallRight()
Follow the wall to the right. |
boolean |
rightIsClear()
Return true if there is no wall to the immediate right of this robot |
void |
step()
Make one step of progress toward the goal. |
void |
turnRight()
Turns this robot right. |
Methods inherited from class alice.kareltherobot.Robot |
---|
anyBeepersInBeeperBag, facingEast, facingNorth, facingSouth, facingWest, frontIsClear, nextToABeeper, nextToARobot |
Methods inherited from class alice.kareltherobot.UrRobot |
---|
addToWorld, assertFacingEast, assertFacingNorth, assertFacingSouth, assertFacingWest, assertFrontIsBlocked, assertFrontIsClear, assertHasBeepers, assertHasNoBeepers, assertNextToABeeper, assertNextToARobot, assertOnAvenue, assertOnStreet, draw, getCamera, move, pickBeeper, putBeeper, setTracing, toString, turnLeft, turnOff |
Methods inherited from class org.alice.apis.moveandturn.gallery.scifi.KoalaRobot |
---|
getPart |
Methods inherited from class org.alice.apis.moveandturn.gallery.GalleryModel |
---|
getGalleryRootDirectory, getModeledByCredit, getPaintedByCredit, getProgrammedByCredit, main, setModeledByCredit, setPaintedByCredit, setProgrammedByCredit |
Methods inherited from class org.alice.apis.moveandturn.PolygonalModel |
---|
getPolygons, setPolygons |
Methods inherited from class org.alice.apis.moveandturn.Model |
---|
addMouseButtonListener, addPotentialSurfaceTexture, clearPotentialSurfaceTextures, getColor, getFillingStyle, getMouseButtonListeners, getOpacity, getOriginalScale, getPart, getPotentialSurfaceTextureIterable, getPotentialSurfaceTextures, getResizeDepthAmount, getResizeHeightAmount, getResizeWidthAmount, getSGSingleAppearance, getSGVisual, getShadingStyle, getSurfaceTexture, getVisualScale, isShowing, removeMouseButtonListener, removePotentialSurfaceTexture, setColor, setColor, setColor, setColor, setFillingStyle, setName, setOpacity, setOpacity, setOpacity, setOpacity, setPotentialSurfaceTextures, setShadingStyle, setShowing, setSurfaceTexture, setVisualScale |
Methods inherited from class org.alice.apis.moveandturn.Transformable |
---|
addKeyListener, getAxisAlignedMinimumBoundingBox, getAxisAlignedMinimumBoundingBox, getAxisAlignedMinimumBoundingBox, getAxisAlignedMinimumBoundingBox, getBoundingSphere, getBoundingSphere, getBoundingSphere, getBoundingSphere, getDepth, getDistanceAbove, getDistanceBehind, getDistanceBelow, getDistanceInFrontOf, getDistanceTo, getDistanceToTheLeftOf, getDistanceToTheRightOf, getHeight, getKeyListeners, getSGAbstractTransformable, getSGTransformable, getVehicle, getWidth, isAbove, isAbove, isAtLeastThresholdAwayFrom, isBehind, isBehind, isBelow, isBelow, isBoundingBoxShowing, isBoundingSphereShowing, isInFrontOf, isInFrontOf, isLargerThan, isNarrowerThan, isShorterThan, isSmallerThan, isTallerThan, isThickerThan, isThinnerThan, isToTheLeftOf, isToTheLeftOf, isToTheRightOf, isToTheRightOf, isWiderThan, isWithinThresholdOf, realizeIfNecessary, removeKeyListener, resize, resize, resize, resize, resizeDepth, resizeDepth, resizeDepth, resizeDepth, resizeDepth, resizeHeight, resizeHeight, resizeHeight, resizeHeight, resizeHeight, resizeWidth, resizeWidth, resizeWidth, resizeWidth, resizeWidth, say, say, say, say, say, say, setBoundingBoxShowing, setBoundingSphereShowing, setDepth, setDepth, setDepth, setDepth, setDepth, setHeight, setHeight, setHeight, setHeight, setHeight, setVehicle, setWidth, setWidth, setWidth, setWidth, setWidth, think, think, think, think, think, think |
Methods inherited from class org.alice.apis.moveandturn.AbstractTransformable |
---|
getLocalPointOfView, getLocalTransformation, getOrientation, getOwner, getPosition, getScene, getSGComposite, getTransformation, getTransformation, isPivotShowing, move, move, move, move, moveAndOrientTo, moveAndOrientTo, moveAndOrientTo, moveAtSpeed, moveAtSpeed, moveAtSpeed, moveAwayFrom, moveAwayFrom, moveAwayFrom, moveTo, moveTo, moveTo, moveToward, moveToward, moveToward, orientTo, orientTo, orientTo, orientToUpright, orientToUpright, orientToUpright, orientToUpright, pointAt, pointAt, pointAt, roll, roll, roll, roll, rollAtSpeed, rollAtSpeed, rollAtSpeed, setLocalPointOfView, setLocalTransformation, setPivotShowing, turn, turn, turn, turn, turnAtSpeed, turnAtSpeed, turnAtSpeed, turnToFace, turnToFace, turnToFace |
Methods inherited from class org.alice.apis.moveandturn.Composite |
---|
addComponent, clearComponents, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandIn, createOffsetStandInIfNecessary, delay, findAllMatches, findAllMatches, findAllMatches, findAllMatches, findAllMatches, findFirstDescendantNamed, findFirstMatch, findFirstMatch, findFirstMatch, findFirstMatch, findPathsToAllDescendants, getActualReferenceFrame, getBooleanFromUser, getComponentIterable, getComponents, getDescendant, getDoubleFromUser, getGlobalSimulationSpeedFactor, getIntegerFromUser, getLookingGlass, getName, getPointOfView, getSGReferenceFrame, getStringFromUser, print, removeComponent, setComponents, setGlobalSimulationSpeedFactor, transformFromAWT, transformFromAWT, transformToAWT, transformToAWT |
Methods inherited from class org.alice.apis.moveandturn.Element |
---|
getElement, isComposedOfGetterAndSetterProperties |
Methods inherited from class edu.cmu.cs.dennisc.pattern.DefaultInstancePropertyOwner |
---|
accessListPropertyListeners, accessPropertyListeners, addListPropertyListener, addPropertyListener, decode, encode, equals, fireAdded, fireAdding, fireCleared, fireClearing, firePropertyChanged, firePropertyChanging, fireRemoved, fireRemoving, fireSet, fireSetting, getInstancePropertyNamed, getProperties, getPropertyNamed, isEquivalentTo, lookupNameFor, removeListPropertyListener, removePropertyListener |
Methods inherited from class edu.cmu.cs.dennisc.pattern.AbstractElement |
---|
accessNameListeners, addNameListener, removeNameListener |
Methods inherited from class edu.cmu.cs.dennisc.pattern.DefaultReleasable |
---|
accessReleaseListeners, addReleaseListener, release, removeReleaseListener |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WallFollower(int street, int avenue, alice.kareltherobot.Direction direction)
street
- the street on which to place the robotavenue
- the avenue on which to place the robotdirection
- the direction the robot will initially facepublic WallFollower(int street, int avenue, alice.kareltherobot.Direction direction, int beepers)
street
- the street on which to place the robotavenue
- the avenue on which to place the robotdirection
- the direction the robot will initially facebeepers
- the initial number of beepers in the beeper bagpublic WallFollower(int street, int avenue, alice.kareltherobot.Direction direction, int beepers, org.alice.apis.moveandturn.Color color)
street
- the street on which to place the robotavenue
- the avenue on which to place the robotdirection
- the direction the robot will initially facebeepers
- the initial number of beepers in the beeper bagcolor
- the color of this robotMethod Detail |
---|
public void turnRight()
public boolean rightIsClear()
public void followWallRight()
public void step()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |