This repository was archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.properties
More file actions
291 lines (274 loc) · 13.8 KB
/
default.properties
File metadata and controls
291 lines (274 loc) · 13.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
#####################################
## Project ##
#####################################
# Name of your project. This has no effect whatsover on anything
# so it is only for your convenience and can easily be left out.
evo.project.name=Evocode Project
# Location of robocode on your computer. Defaults:
# Windows: C:/robocode
# Linux: /robocode
evo.project.robocodeLocation=C:/robocode
# Name of the Java package to be generated. This will be the package
# structure in your generated Java file and will affect to location
# under which your robot will be compiled under /robocode/robots
# when it is ran.
evo.project.packageName=de.algoristic.evocode
# Class name of the Java class file to be generated. Consider Java
# file nomenclature. Can contain the variables:
# [generation]: number of the current generation, starting with 0
# [individual]: number of the generated individual, starting with 0
evo.project.robotClassName=EvocodeBot
# Prefix of the directory created for every generation.
evo.project.generationDirectoryPrefix=generation_
# Prefix of the directory created for every individual inside the
# generation directory. (Please note that the individual directory
# is only temporary for compiling.)
evo.project.individualDirectoryPrefix=tmp.individual_
#####################################
## Running the app ##
#####################################
# Determines of an evolution.log file will be generated for your project.
evo.run.writeLog=true|false
# Determines the termination condition for the current run of your project.
evo.run.termination=iterations|timer|convergence
# Stop the run after the stated iterations.
evo.run.iterations=1
# Timeunit for your timeout. Can be anything that is found inside
# java.util.concurrent.TimeUnit. (E.g. days, hours, minuts, seconds, ...)
evo.run.timer.unit=hours
# Amount of units of your chosen TimeUnit.
evo.run.timer.time=1
# The run stops after $convergence fitness is reached by any individual
# of the last generation.
evo.run.convergence=30000
#####################################
## Genome generation and structure ##
#####################################
# Setup the main method of your robot.
# Please take care of placing the `\` to determin each line at the very
# end of the line, leaving no trailing whitespaces.
evo.genome.mainMethod=\
while(true) {\
turnGunRight(10.0d);\
}
# The amount of genes in your genome. What this means is determined by
# the structure of your genome.
evo.genome.genes=24
# For LinearGP.dna, see `genome.dna.properties`.
# For LinearGP.nn, see `genome.nn.properties`
evo.genome.structure=LinearGP.nn|LinearGP.dna
# Advanced parameter: allows you to define a template that
# will be filled with the generated code.
# Beware: depending on your genome.structure this has two different meanings:
# LinearGP.dna : possible values are basic|advanced
# basic = src/main/resources/dna.basic.template
# advanced = src/main/resources/dna.advanced.template
# LinearGP.nn : possible values are basic|<path>
# basic = src/main/resources/nn.basic.template
# <path> = path to your custom template
# See src/main/resources/nn.advanced.template for an impression.
evo.genome.robotTemplate=basic
#####################################
## DNA Programing ##
#####################################
# Every gene consists of hexadecimal characters and one
# leading non-hexadecimal char. (E.g. k1457ea0)
# The leading char ('k') defines the method where this gene will
# represents be decoded to java-code.
# Next three chars ('145') define the control structure to be
# applied (if, while, do-while, plain code) and where its
# conditions come from.
# The following pairs of chars ('7e', 'a0') define the instructions
# to be coded and their respective values.
# (E. g. '7' encode 'Robot::fire' and 'e' encodes '90% of max. power'.)
# Defines the minimum size of each gene.
# Note, that 5 is the absolute minimum, any smaller values
# will be overridden by the application.
evo.genome.dnaProgramming.gene.minSize=5
evo.genome.dnaProgramming.gene.maxSize=6
# Every gene consists of n hexadecimal characters.
# Every two characters encode one line of code.
# Consider the following genome:
# af36e1
# If overlapping e=false this gene encodes:
# g1=af, g2=36, g3=e1
# if overlapping=true this gene encodes:
# g1=af, g2=f3, g3=36, g4=6e, g5=e1
# This behaviour can be watched in some forms of viral
# dna and can lead to a much higher genetic variability
# because any mutation that occurs will lead to the
# modification of two instructions.
evo.genome.dnaProgramming.gene.overlapping=true|false
#####################################
## Neural Network Generation ##
#####################################
# Every gene encodes one explicit connection in a neural network
# with three layers:
# sensor layer: the values the robot can obtain at a given time
# (reduced to a value between -1.0 .. 1.0)
# e.g.: current x-axis value relative to the
# total width of the battlefield.
# hidden layer: sums up its inputs with the function
# tanh(sum(inputs)) which results in
# a value between -1.0 .. 1.0
# action layer: sums up its inputs analogous to the hidden layer
# and forwards it to an explicit output.
# The gene encodes input (src) and output (sink) of the connection
# as well as its weight. Every aspect of this gets generated randomly,
# so it is totally possibily for neurons in the hidden layer to be
# connected to each other or to itself.
# However, connections that have no input or never lead to an output
# will not be generated to prevent them from being calculated each
# and every turn of a game.
# Every connection comes with a default weight of -32.768 .. 32.767,
# and as this is too much, we reduce the weight by a fixed divisor.
# E.g.:
# 8.192 -> -4.0..4.0
# 16.384 -> -2.0..2.0
# 32.768 -> -1.0..1.0
evo.genome.nn.weightFlattener=32768
# Number of hidden neurons in the hidden layer.
evo.genome.nn.hiddenNeurons=16
# All possible sensors for the robot. Note that most of them are tied
# to specific robot event handlers and will therefore only be fired when
# that event handler is called.
# That said the first four lines of sensors should speak for themselves.
# The 5th line ('distanceRemaining, ...') are sensors that sense the
# movement of robot, gun or radar that has to be completed until the
# next action can be placed.
# The 6th line are one kind of RNN cell sensors. Every time the robot
# performs an action the explicit value of that action (movement distance,
# turning degree, firepower) is fed back into a loop that gets sensed by
# theese. They provide a constant stream of inputs reflecting the actions,
# because every turn the robot does not perform any kind of action a plain
# '0' is fed into the loop.
evo.genome.nn.allowedSensors=\
positionX, positionY, otherPlayers, round, turn, heading, radarHeading, gunHeading, gunHeat, velocity, energy,\
myBulletHeading, myBulletPower, myBulletVelocity, myBulletX, myBulletY,\
enemyBulletHeading, enemyBulletPower, enemyBulletVelocity, enemyBulletX, enemyBulletY,\
enemyEnergy, enemyBearing, enemyHeading, enemyDistance, enemyBulletBearing, wallBearing,\
distanceRemaining, turnRemaining, gunTurnRemaining, radarTurnRemaining,\
moveFeedback, turnFeedback, turnGunFeedback, turnRadarFeedback, fireFeedback
# All possible actions the robot can perform. The upper line should be self
# explaining: this are the standard actions a Robot or AdvancedRobot can perform.
# For the second line please consider reading 'evo.genome.nn.maxTurnAwareness'.
evo.genome.nn.allowedActors=\
ahead, back, fire, turnLeft, turnRight, turnGunLeft, turnGunRight, turnRadarLeft, turnRadarRight,\
raiseTurnAwareness, reduceTurnAwareness
# Defines the maximum distance value that can be fed into the actions
# ahead(d) and back(d).
evo.genome.nn.action.move.min=0
evo.genome.nn.action.move.max=50
# Defines the maximum degree value that can be fed into the actions
# turnLeft(d), turnRight(d), turnGunLeft(d), turnGunRight(d),
# turnRadarLeft(d) and turnRadarRight(d)
# Note that the overall maximum is 359 degrees.
evo.genome.nn.action.turn.min=0
evo.genome.nn.action.turn.max=44
# Defines the maximum firepower for the action fire(p).
# Note that this values must lay between 0.1 .. 3.0 defined by battle rules.
evo.genome.nn.action.fire.min=0.1
evo.genome.nn.action.fire.max=3.0
# Note that robocode uses the terms turn for one tick of the calculation
# of the game. The sensor 'turn' retrieves the current value of this property.
# Every other sensor can easily be flattened to -1.0 .. 1.0 because there are
# absolute limits for them - except for the 'turn'. So we divide that value by
# 'maxTurnAwareness' (and limit it by '1').
# Resulting, the sensor 'turn' retrieves a constantly raising value until
# the maximum turn is reached and it resolves to 1, which represents some
# kind of level of high alert.
evo.genome.nn.maxTurnAwareness=10000
# Add boilerplate code to any of the robot event handlers.
# The first method defines the number of lines, the following
# define the content of each line.
evo.genome.nn.scannedRobot.boilerplate=3
evo.genome.nn.scannedRobot.boilerplate.1=if(true) {
evo.genome.nn.scannedRobot.boilerplate.2= fire(1.0d);
evo.genome.nn.scannedRobot.boilerplate.3=}
#####################################
## Island setup ##
#####################################
# The total amount of individuals of a generation will be equally
# distributed over the defined number of islands. The islands stay
# isolated from each other unless a migration happens. This leads
# to a partition of the search space and can produce a number of
# totally different apporaches to the solution.
evo.strategy.islands.num=1
# There are two types of migration:
# random: Let's individuals more or less uncrolled jump between
# islands (just as the name states).
# ring: The ring migration leads to a more controlled behaviour,
# where the migration individuals travel to the next
# adjascent island.
# For the '0' in this (evo.gen.'0'.islands...) see the next part.
evo.gen.0.islands.migration=ring, random
# Each migration is defined by an epoch (the amount of generations
# until the next migration happens). So a migration happens if
# `generation % epoch == 0`.
evo.gen.0.islands.migration.ring.epoch=10
evo.gen.0.islands.migration.random.epoch=10
# Each migration is also defined by a percentual chance for an
# individual to actually migrate. Please note, that this chance
# will be applied for every defined migration type on its own.
# This means, when rang and random both are defined with a 1% chance,
# of 100 individuals there will most likely be 2 that will be migrated.
evo.gen.0.islands.migration.ring.chance=0.01
evo.gen.0.islands.migration.random.chance=0.01
#####################################
## Evolution control ##
#####################################
# Preface:
# Evolution control, as well as migration control for the islands,
# is designed to be set generation specific, denoted by the number
# after 'evo.gen.'. The parameters are set by the highlander principle,
# so the highest number, that applies to your generation will be used.
# It is good practice to start defining everything for generation 0
# in the first place and then start making generation specific changes.
# This highly increases the readability and traceability of parameter
# changes throughout the project.
# Please note that the .properties will be re-read anytime before a
# new generation is generated, so there is no need to override your
# settings, that already produced a generation.
# Parameters:
# Determines the size of any generated generation. This number of
# indivduals will be spread equally over the defined number of islands.
evo.gen.0.generation.size=100
# The fitness function will be applied to rate every indivil's
# performance. So, designing a fitness function that fits your needs
# is a key step for your evolution to succeed.
# Possible variables:
# [score]: The score your individual reached in the evaluation
# [percentage]: Your score / total score
# [rank]: Overall rank of your individual in the evaluation.
# (Thanks to robocode API this is always 1)
# Please note that the fitness function will always produce an integer value.
# Other possible variables:
# [lastSurvivorBonus], [survival], [bulletDamage], [bulletDamageBonus],
# [ramDamage], [ramDamageBonus], [firsts], [seconds], [thirds]
evo.gen.0.fitnessFunction=([percentage] * 100)
# Fully qualified names of the enemies your indivduals should be facing.
evo.gen.0.enemies=sample.Corners, sample.Crazy
# Define the width and height of the battlefield in pixels.
evo.gen.0.battlefield.width=800
evo.gen.0.battlefield.height=600
# Define the number of rounds your bot will fight against the enemies.
evo.gen.0.battleRounds=35
# The selectors that will be applied to determine the individuals, that
# will breed the next generation.
evo.gen.0.selectors=elite, rank, rouletteWheel, tournament
# Define the output number of individuals for each selector.
# Note that this number must meet the generation size as stated in
# 'evo.gen.$g.generation.size'.
# Also note that this number will be applied to every single island as stated
# in 'evo.strategy.islands.num'.
# Meaning, if you have have 100 individuals on 2 islands, the combined
# output of all selectors must meet the amount of 50 indivduals.
evo.gen.0.selector.elite.out=10
evo.gen.0.selector.rank.out=30
evo.gen.0.selector.rouletteWheel.out=30
evo.gen.0.selector.tournament.out=30
# As of today there is only one mutator implemented. The point mutatation is
# a bit flip on a random point in the genome. You can adjust the chance
# for any bit in the genome of a newly created individual to be mutated.
evo.gen.0.mutators=point
evo.gen.0.mutator.point.mutationRate=.01