Package edu.tufts.hrilab.supermarket
Class SupermarketComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.supermarket.SupermarketComponent
- All Implemented Interfaces:
PlanningAgent,SupermarketInterface
public class SupermarketComponent
extends DiarcComponent
implements SupermarketInterface, PlanningAgent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected edu.tufts.hrilab.supermarket.GamePlayprotected static booleanprotected intprotected SupermarketInterfaceprotected intprotected intprotected doubleprotected booleanprotected booleanFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>Override this method to define command line options available in sub-class.protected Stringprotected List<SupermarketObservation.InteractiveObject>final Justificationprotected StringcartName(int cartIndex) voidvoidfoodName(SupermarketObservation.Counter counter) protected SupermarketObservation.InteractiveObjectintfinal Justificationfinal JustificationgoEast()final JustificationgoNorth()final JustificationgoSouth()final JustificationgoWest()protected voidinit()Perform any component initialization.final JustificationbooleanisBusy()lastCart()final Justificationnop()objectObserver(Term state) protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class.reactive_nav(Symbol goal) final Justificationfinal JustificationrotateCW()voidsetBusy(boolean busy) voidsetObservation(Object observation) voidprotected intfinal Justificationprotected voidprotected voidMethods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, executionLoop, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown, shutdownComponent
-
Field Details
-
loadedInitialBeliefs
protected static boolean loadedInitialBeliefs -
game
protected edu.tufts.hrilab.supermarket.GamePlay game -
agentName
-
playerIndex
protected int playerIndex -
useBelief
protected boolean useBelief -
socketPort
protected int socketPort -
simSocketPort
protected int simSocketPort -
simComponent
-
useSim
protected boolean useSim -
STEP
protected double STEP
-
-
Constructor Details
-
SupermarketComponent
public SupermarketComponent() -
SupermarketComponent
-
-
Method Details
-
init
protected void init()Description copied from class:DiarcComponentPerform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.- Overrides:
initin classDiarcComponent
-
additionalUsageInfo
Description copied from class:DiarcComponentOverride this method to define command line options available in sub-class. This should be paired with a parseArgs implementation.- Overrides:
additionalUsageInfoin classDiarcComponent- Returns:
-
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Description copied from class:DiarcComponentOverride this method to parse command line args in the sub-class. Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.- Overrides:
parseArgsin classDiarcComponent
-
nop
- Specified by:
nopin interfaceSupermarketInterface
-
goNorth
- Specified by:
goNorthin interfaceSupermarketInterface
-
goSouth
- Specified by:
goSouthin interfaceSupermarketInterface
-
goEast
- Specified by:
goEastin interfaceSupermarketInterface
-
goWest
- Specified by:
goWestin interfaceSupermarketInterface
-
goDir
- Specified by:
goDirin interfaceSupermarketInterface
-
rotateCW
- Specified by:
rotateCWin interfaceSupermarketInterface
-
rotateCCW
- Specified by:
rotateCCWin interfaceSupermarketInterface
-
pickup
- Specified by:
pickupin interfaceSupermarketInterface
-
cancelInteraction
- Specified by:
cancelInteractionin interfaceSupermarketInterface
-
toggleShoppingCart
- Specified by:
toggleShoppingCartin interfaceSupermarketInterface
-
interactWithObject
- Specified by:
interactWithObjectin interfaceSupermarketInterface
-
startGame
- Specified by:
startGamein interfaceSupermarketInterface
-
resetGame
- Specified by:
resetGamein interfaceSupermarketInterface
-
getLastObservation
- Specified by:
getLastObservationin interfaceSupermarketInterface
-
setObservation
- Specified by:
setObservationin interfaceSupermarketInterface
-
objectObserver
-
transmitPlayerInitialBeliefs
protected void transmitPlayerInitialBeliefs() -
transmitInitialBeliefs
protected void transmitInitialBeliefs() -
enableSim
public void enableSim() -
disableSim
public void disableSim() -
setSimObservation
public void setSimObservation() -
getSimPort
- Specified by:
getSimPortin interfaceSupermarketInterface
-
cartName
-
foodName
-
foodName
-
lastCart
- Specified by:
lastCartin interfaceSupermarketInterface
-
getAgentName
- Specified by:
getAgentNamein interfaceSupermarketInterface
-
getPlayerIndex
public int getPlayerIndex()- Specified by:
getPlayerIndexin interfaceSupermarketInterface
-
aisleName
-
shelfIndex
-
allObjects
-
getInteractionTarget
-
isBusy
public boolean isBusy()- Specified by:
isBusyin interfacePlanningAgent
-
setBusy
public void setBusy(boolean busy) - Specified by:
setBusyin interfacePlanningAgent
-