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 StateMachineprotected intprotected 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>Command line options available in sub-class.protected StringaisleObserver(Term state) protected List<SupermarketObservation.InteractiveObject>final Justificationprotected StringcartName(int cartIndex) voidvoidfoodName(SupermarketObservation.Counter counter) protected SupermarketObservation.InteractiveObjectintfinal JustificationgoEast()final JustificationgoNorth()final JustificationgoSouth()final JustificationgoWest()protected voidinit()Perform any component initialization.final JustificationbooleanisBusy()lastCart()navigationObserver(Term state) final Justificationnop()objectObserver(Term state) protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Called directly after construction to pass runtime values that will override default values.voidsetBusy(boolean busy) voidsetObservation(Object observation) voidvoidvoidprotected intfinal Justificationprotected voidvoidprotected 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
-
sm
-
useSim
protected boolean useSim
-
-
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:DiarcComponentCommand 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:DiarcComponentCalled directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.zs- 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
-
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
-
aisleObserver
-
objectObserver
-
transmitPlayerInitialBeliefs
protected void transmitPlayerInitialBeliefs() -
transmitInitialBeliefs
protected void transmitInitialBeliefs() -
transmitNewCartBeliefs
public void transmitNewCartBeliefs()- Specified by:
transmitNewCartBeliefsin interfaceSupermarketInterface
-
enableSim
public void enableSim() -
disableSim
public void disableSim() -
setSimObservation
public void setSimObservation() -
getSimStateMachine
-
setSimStateMachine
-
getSimPort
- Specified by:
getSimPortin interfaceSupermarketInterface
-
getStateMachine
- Specified by:
getStateMachinein interfaceSupermarketInterface
-
setStateMachine
- Specified by:
setStateMachinein 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
-