|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.uni_paderborn.robots.robot.group10.CardFinder
| Field Summary | |
(package private) AbstractStrategy |
cardStrat
the different strategies |
(package private) boolean |
cardStratActive
variable which is set if the card-strategy is active |
(package private) RobotData |
currentRobotData
reference to the current data of the robot |
(package private) int |
direction
value of the current direction of the robot |
private int |
energyLastRound
temp variable for energy from last round |
(package private) AbstractStrategy |
energyStrat
the different strategies |
(package private) boolean |
energyStratActive
variable which is set if the energy-strategy is active |
(package private) int |
exceptionCnt
counter for the exceptions in a row |
(package private) boolean |
exitKnown
variable which is set if the exit is known |
(package private) AbstractStrategy |
exitStrat
the different strategies |
(package private) boolean |
exitStratActive
variable which is set if the exit-strategy is active |
(package private) Map |
map
reference to the map of the robot |
(package private) boolean |
mapFound
attribute if the right one of the three maps already have been found |
(package private) Map |
mapLeft
reference to the map of the robot |
(package private) Map |
mapRight
reference to the map of the robot |
(package private) static int |
MAX_EXCEPTIONS
maximum number of exceptions in a row before an exception handling is forced |
(package private) static int |
MAX_NOACTIONS
maximum number of noactions in a row before an exception handling is forced |
private int |
maxEnergy
memorizes maxEnergy |
(package private) AbstractStrategy |
moveStrat
the different strategies |
(package private) int |
noActionCnt
counter for the noActions in a row |
protected java.util.Random |
random
random number generator |
(package private) AbstractStrategy |
stupidStrat
the different strategies |
private int |
tmpEnergy
memorizes maxEnergy |
private int |
turnNo
turn counter |
(package private) boolean |
wholeArenaKnown
variable which is set if the whole arena is known |
| Constructor Summary | |
CardFinder()
constructor |
|
| Method Summary | |
CardData |
calcNewCardValue(CardData newCard)
If the robot has to put down a card this function supplies the card to put down. |
boolean |
cardsInFront()
This method returns if the robots is seeing any card in front, left or right |
static void |
debugPrintln(java.lang.String s)
Method which is used for diagnostic output |
boolean |
exchangeOk(CardData myCard,
CardData otherCard)
Robot accepts cards exchange, if new cards would be better. |
CardData |
exchangeProposal(CardData[] cards)
Returns an random card, if the robot has at least one card. |
boolean |
getCardStratActive()
Method for getting the status of the card strategy |
AbstractRobotAction |
getCommand(RobotData robotData)
Returns the next command. |
int |
getDirection()
Method to access the direction |
int |
getEnergy()
This method returns the current Energy of the robot |
int |
getEnergyLastRound()
This method returns the value of the energy in the last round |
boolean |
getEnergyStratActive()
Method for getting the status of the energy strategy |
boolean |
getExitStratActive()
Method for getting the status of the exit strategy |
CardData[] |
getHand()
This method returns the hand from currentRobotData |
int |
getIdOfCurrentField()
This method returns the id of the field where the robot is currently |
int |
getIdOfFieldInFront()
This method returns the id of the fieldID in front of the robot |
int |
getIdOfFieldLeft()
This method returns the id of the fieldID left of the robot |
int |
getIdOfFieldRight()
This method returns the id of the fieldID right of the robot |
ItemData |
getItemInFrontOfRobot()
This method returns a reference to the item in front of the robot |
ItemData |
getItemLeftOfRobot()
This method returns a reference to the item left of the robot |
ItemData |
getItemRightOfRobot()
This method returns a reference to the item right of the robot |
Map |
getMap()
Method which returns a reference to the current map |
int |
getMaxEnergy()
Method which return the maximum of energy a robot can have |
AbstractStrategy |
getMoveStrat()
This method returns a reference to the move strategy of the robot |
void |
initCardFinder()
method to initialize the cardfinder |
boolean |
isExitKnown()
access method whether the exit is known or not |
boolean |
isWholeArenaKnown()
access method whether whole arena is known or not |
void |
setCardStratActive(boolean value)
Method for setting the status of the card strategy |
void |
setDirection(int value)
Method to set the direction |
void |
setEnergyLastRound(int value)
Method to set the energy to compare it in the next round |
void |
setEnergyStratActive(boolean value)
Method for setting the status of the energy strategy |
void |
setExitKnown()
method which is called when the exit is found |
void |
setExitStratActive(boolean value)
Method for setting the status of the exit strategy |
void |
setMap(Map value)
This method returns a reference to the map of the robot |
void |
setMaxEnergy(int value)
Method which sets the maximum of energy a robot can have |
void |
setWholeArenaKnown(boolean value)
Method for setting the status if the whole arena is known |
int |
sizeOfPortable()
This method returns the number of cards the robot has |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.util.Random random
int exceptionCnt
static int MAX_EXCEPTIONS
int noActionCnt
static int MAX_NOACTIONS
RobotData currentRobotData
Map map
Map mapLeft
Map mapRight
boolean mapFound
int direction
private int maxEnergy
private int tmpEnergy
private int turnNo
private int energyLastRound
AbstractStrategy moveStrat
AbstractStrategy energyStrat
AbstractStrategy stupidStrat
AbstractStrategy exitStrat
AbstractStrategy cardStrat
boolean energyStratActive
boolean exitStratActive
boolean cardStratActive
boolean wholeArenaKnown
boolean exitKnown
| Constructor Detail |
public CardFinder()
| Method Detail |
public void initCardFinder()
public AbstractRobotAction getCommand(RobotData robotData)
getCommand in interface RobotFunctionsrobotData - a reference to the data of the robotpublic CardData exchangeProposal(CardData[] cards)
exchangeProposal in interface RobotFunctionscards - a reference to the cards of the robot
public boolean exchangeOk(CardData myCard,
CardData otherCard)
exchangeOk in interface RobotFunctionsde.uni_paderborn.robots.robotArenaInterface.RobotFunctionsmyCard - card the robot wants to give awayotherCard - card the robot wants to havepublic static void debugPrintln(java.lang.String s)
s - the string which should be promptedpublic boolean getEnergyStratActive()
public void setEnergyStratActive(boolean value)
value, - true if the strategy should be set activepublic boolean getExitStratActive()
public void setExitStratActive(boolean value)
value, - true if the strategy should be set activepublic boolean getCardStratActive()
public void setCardStratActive(boolean value)
value, - true if the strategy should be set activepublic boolean isWholeArenaKnown()
public void setWholeArenaKnown(boolean value)
value, - true if the whole arena is knownpublic boolean isExitKnown()
public void setExitKnown()
public int getDirection()
public void setDirection(int value)
value - the int-value of the directionpublic int getEnergy()
public int getEnergyLastRound()
public void setEnergyLastRound(int value)
value - the int-value of the energypublic int getMaxEnergy()
public void setMaxEnergy(int value)
value - maximum of energy a robot can havepublic CardData[] getHand()
public int getIdOfCurrentField()
public int getIdOfFieldInFront()
public ItemData getItemInFrontOfRobot()
public int getIdOfFieldLeft()
public ItemData getItemLeftOfRobot()
public int getIdOfFieldRight()
public ItemData getItemRightOfRobot()
public boolean cardsInFront()
public void setMap(Map value)
reference - to the map of the robotpublic Map getMap()
public int sizeOfPortable()
public AbstractStrategy getMoveStrat()
public final CardData calcNewCardValue(CardData newCard)
newCard - the card to evaluate with the current cardset.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||