# Bruker:Mwaandah

(Forskjeller mellom versjoner)
Gå til: navigasjon, søk
 Versjonen fra 7. des 2018 kl. 11:53 (vis kilde)← Eldre redigering Versjonen fra 7. des 2018 kl. 11:54 (vis kilde)Nyere redigering → Linje 3: Linje 3: [[Fil:robot19-and-9989.png|500px]]] [[Fil:robot19-and-9989.png|500px]]] - ===New fitness function(generation 19 and 9992)=== + ===New fitness function(generation 19(dark green) and 9992(light green))=== [[Fil:newfitnessrobot19androbot9992.png|500px]] [[Fil:newfitnessrobot19androbot9992.png|500px]] - ===Change of fitness function(generation 19(dark green) and 9992(light green))=== + ===Change of fitness function=== def fitness(self): def fitness(self):

## Versjonen fra 7. des 2018 kl. 11:54

]

### Change of fitness function

def fitness(self):

```      """
Fitness is proportional to both the displacement and absolute
velocity of the center of mass of the robot, in the formula:
```
```      (1 - d l) * (a dS + b S + c l)
```
```      Where dS is the displacement over a direct line between the
start and end points of the robot, S is the distance that
the robot has moved and l is the robot size.
```
```      Since we use an active speed window, we use this formula
in context of velocities instead. The parameters a, b and c
are modifyable through config.
:return:
"""
age = self.age()
if age < (0.25 * self.conf.evaluation_time) or age < self.conf.warmup_time:
# We want at least some data
return 0.0
```
```      v_fac = self.conf.fitness_velocity_factor
d_fac = self.conf.fitness_displacement_factor
s_fac = self.conf.fitness_size_factor
d = 1.0 - (self.conf.fitness_size_discount * self.size)
v = d * (d_fac * self.displacement_velocity() + v_fac * self.velocity() + s_fac * self.size)
return v if v <= self.conf.fitness_limit else 0.0
```

def displacement_velocity(self):

```      """
Returns the displacement velocity, i.e. the velocity
between the first and last recorded position of the
robot in the speed window over a straight line,
ignoring the path that was taken.
:return:
"""
dist, time = self.displacement()
if time.is_zero():
return 0.0
```
```      return dist.x / float(time)
#Old: return np.sqrt(dist.x**2 + dist.y**2) / float(time)
```

Plan for master year:

Week Plan
Week 38 Essay delivery
Week 39 Get used to simulator program
Week 40 Get used to simulator program and make first program in it
Week 41 Get used to simulator
Week 42 Plan experiment
Week 43 Plan experiment
Week 44 1st experiment
Week 45 1st experiment
Week 46 1st experiment
Week 47 2nd experiment
Week 48 2nd experiment
Week 49 2nd experiment
Week 50 3rd experiment
Week 51 3rd experiment
Week 52 Christmas
Week 1 3rd experiment
Week 4 Discussion
Week 5 Discussion
Week 6 Discussion
Week 10
Week 11
Week 12
Week 13
Week 14