public class SimpleSoccer extends AbstractMultiProblem
AbstractMultiProblem.RepresentationWithScore
Modifier and Type | Field and Description |
---|---|
int |
aktStep |
int[] |
ball_goal_scores |
static int |
BALL_GOAL_WEIGHT |
int[] |
balldistscores |
static boolean |
CARTESIANOUTPUT |
static int |
EVALTIME |
int[] |
falsekicks |
long[] |
finalscores |
static int |
KICK_WEIGHT |
int[][] |
kicknum |
int[] |
kicknumsum |
static int |
NEAREST_BALL_DISTANCE_WEIGHT |
AbstractRepresentation[] |
nets |
static int |
PLAYERS_PER_TEAM |
SimPlayer[][] |
playersinteams
Players in an array
|
static int |
POSITION_WEIGHT |
static int |
SCORE_WEIGHT |
int[] |
scorenum
Number of real scores
|
int[] |
scores
Position scores
|
SimpleServer |
simpleserver |
int |
stepnumber |
java.lang.String[] |
tname
Team names
|
boolean |
withmonitor |
boolean |
withpause |
Constructor and Description |
---|
SimpleSoccer() |
Modifier and Type | Method and Description |
---|---|
java.util.Hashtable<java.lang.String,XMLFieldEntry> |
adjustRequirements(java.util.Hashtable<java.lang.String,XMLFieldEntry> requirements,
java.util.Hashtable<java.lang.String,XMLFieldEntry> properties)
Adjusts and returns the requirements of this problem that is modified according to the properties.
|
java.util.List<AbstractMultiProblem.RepresentationWithScore> |
evaluateFitness(AbstractRepresentation[] candidates)
Returns the fitness of the given representations.
|
void |
placeBall()
Places the ball to the starting position
|
void |
placePlayers()
Places all players to the starting positions
|
void |
replayWithVisualization(AbstractRepresentation[] candidates)
This function is called when the user request a visual replay from the problem.
|
java.util.List<AbstractMultiProblem.RepresentationWithScore> |
runSimulation() |
void |
sendSensordata()
Sends sensor data to the players
|
int |
teamname2int(java.lang.String teamname) |
getRandom, setRandom
getProperties, getPropertyValue, getTypeOfProperty, getXMLData, setProperties, setXMLData
public AbstractRepresentation[] nets
public SimpleServer simpleserver
public SimPlayer[][] playersinteams
public int stepnumber
public boolean withmonitor
public boolean withpause
public java.lang.String[] tname
public int[] scores
public int[] balldistscores
public int[][] kicknum
public int[] kicknumsum
public int[] falsekicks
public int[] ball_goal_scores
public int[] scorenum
public long[] finalscores
public int aktStep
public static int POSITION_WEIGHT
public static int NEAREST_BALL_DISTANCE_WEIGHT
public static int KICK_WEIGHT
public static int BALL_GOAL_WEIGHT
public static int SCORE_WEIGHT
public static int PLAYERS_PER_TEAM
public static int EVALTIME
public static boolean CARTESIANOUTPUT
public void replayWithVisualization(AbstractRepresentation[] candidates)
AbstractMultiProblem
It is recommended to use advanced threading for display like SwingWorker
.
replayWithVisualization
in class AbstractMultiProblem
candidates
- Array of candidates whose replay has been requested.public java.util.List<AbstractMultiProblem.RepresentationWithScore> evaluateFitness(AbstractRepresentation[] candidates)
AbstractMultiProblem
evaluateFitness
in class AbstractMultiProblem
candidates
- Array of candidates to be evaluated.public java.util.List<AbstractMultiProblem.RepresentationWithScore> runSimulation()
public void sendSensordata()
public int teamname2int(java.lang.String teamname)
public void placePlayers()
public void placeBall()
public java.util.Hashtable<java.lang.String,XMLFieldEntry> adjustRequirements(java.util.Hashtable<java.lang.String,XMLFieldEntry> requirements, java.util.Hashtable<java.lang.String,XMLFieldEntry> properties)
AbstractProblem
adjustRequirements
in class AbstractProblem
requirements
- The set of requirement keys and values read from the source XML file.properties
- The set of property keys and values.