Monday, 15 April 2013

Result on Game 4: Maximize difference between start and finish X accelerometer values.



Should result in the robot turning over as much as possible from lying on its back to lying on its front, or vice versa. 


Bloody Webots fucked up the simulation when it crashed due to not being able to access the server. Have to transfer it onto a dongle. Webots would be a perfect system, if it wasn't for the annoying licence issues that constantly occur due to the high level of Swiss security used!


The fitness function is below... from GameAtom.py



    if self.function == "maximize" and len(self.stateHistory) > 1:
          sumf = 0
          start = 0
          end = 0
          for index, i in enumerate(self.stateHistory):
            for index2, j in enumerate(self.stateHistory[index]):
              if index == 0:
                start = start + self.stateHistory[index][index2]
              if index == len(self.stateHistory)-1:
                end = end + self.stateHistory[index][index2]
              
          return start - end


Now try the variant minimise the difference between start and end positions in the Y accelerometer axis. 


No comments:

Post a Comment