├── evoman ├── __init__.py ├── Base │ ├── __init__.py │ ├── SpriteConstants.py │ └── SpriteDefinition.py ├── images │ ├── bb.jpeg │ ├── bubb.png │ ├── met.png │ ├── met2.png │ ├── mi2.png │ ├── tex2.jpg │ ├── tex3.jpg │ ├── tex4.jpg │ ├── blade.png │ ├── images.jpg │ ├── roles.png │ ├── torna.png │ ├── torna2.png │ ├── wall1.jpg │ ├── wall2.jpg │ ├── water2.jpg │ ├── bullet2_l.png │ ├── bullet2_r.png │ ├── bullet_l.png │ ├── bullet_r.png │ ├── download.jpg │ ├── fireball.png │ ├── fireball2.png │ ├── plataform1.jpg │ ├── plataform2.jpg │ ├── EnemySprites.png │ └── EvoManSprites.png ├── sounds │ ├── open.wav │ ├── scifi003.wav │ └── scifi011.wav ├── roles.tsx ├── roles4.tsx ├── README.md ├── controller.py ├── roles2.tsx ├── roles3.tsx ├── sensors.py ├── map3.tmx ├── map2.tmx ├── map4.tmx ├── map1.tmx ├── enemy6.py ├── enemy8.py ├── enemy2.py ├── enemy1.py ├── enemy4.py ├── enemy5.py ├── enemy3.py └── player.py ├── co_evolution.pdf ├── evoman1.0-doc.pdf ├── multi_evolution.pdf ├── README.md ├── .idea └── vcs.xml ├── loop.sh ├── dummy_demo.py ├── human_demo.py ├── controller_generalist_demo.py ├── controller_specialist_demo.py ├── optimization_dummy.py ├── solutions_demo ├── demo_4.txt ├── demo_all.txt ├── demo_5.txt ├── demo_6.txt ├── demo_7.txt ├── demo_2.txt ├── demo_8.txt ├── demo_1.txt └── demo_3.txt ├── .gitignore ├── demo_controller.py ├── optimization_coevolution_demo.py ├── competition_results_v2.py ├── optimization_generalist_demo.py └── optimization_specialist_demo.py /evoman/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /evoman/Base/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /co_evolution.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/co_evolution.pdf -------------------------------------------------------------------------------- /evoman1.0-doc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman1.0-doc.pdf -------------------------------------------------------------------------------- /multi_evolution.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/multi_evolution.pdf -------------------------------------------------------------------------------- /evoman/images/bb.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/bb.jpeg -------------------------------------------------------------------------------- /evoman/images/bubb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/bubb.png -------------------------------------------------------------------------------- /evoman/images/met.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/met.png -------------------------------------------------------------------------------- /evoman/images/met2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/met2.png -------------------------------------------------------------------------------- /evoman/images/mi2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/mi2.png -------------------------------------------------------------------------------- /evoman/images/tex2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/tex2.jpg -------------------------------------------------------------------------------- /evoman/images/tex3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/tex3.jpg -------------------------------------------------------------------------------- /evoman/images/tex4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/tex4.jpg -------------------------------------------------------------------------------- /evoman/sounds/open.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/sounds/open.wav -------------------------------------------------------------------------------- /evoman/images/blade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/blade.png -------------------------------------------------------------------------------- /evoman/images/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/images.jpg -------------------------------------------------------------------------------- /evoman/images/roles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/roles.png -------------------------------------------------------------------------------- /evoman/images/torna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/torna.png -------------------------------------------------------------------------------- /evoman/images/torna2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/torna2.png -------------------------------------------------------------------------------- /evoman/images/wall1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/wall1.jpg -------------------------------------------------------------------------------- /evoman/images/wall2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/wall2.jpg -------------------------------------------------------------------------------- /evoman/images/water2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/water2.jpg -------------------------------------------------------------------------------- /evoman/images/bullet2_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/bullet2_l.png -------------------------------------------------------------------------------- /evoman/images/bullet2_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/bullet2_r.png -------------------------------------------------------------------------------- /evoman/images/bullet_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/bullet_l.png -------------------------------------------------------------------------------- /evoman/images/bullet_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/bullet_r.png -------------------------------------------------------------------------------- /evoman/images/download.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/download.jpg -------------------------------------------------------------------------------- /evoman/images/fireball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/fireball.png -------------------------------------------------------------------------------- /evoman/images/fireball2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/fireball2.png -------------------------------------------------------------------------------- /evoman/sounds/scifi003.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/sounds/scifi003.wav -------------------------------------------------------------------------------- /evoman/sounds/scifi011.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/sounds/scifi011.wav -------------------------------------------------------------------------------- /evoman/images/plataform1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/plataform1.jpg -------------------------------------------------------------------------------- /evoman/images/plataform2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/plataform2.jpg -------------------------------------------------------------------------------- /evoman/images/EnemySprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/EnemySprites.png -------------------------------------------------------------------------------- /evoman/images/EvoManSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/karinemiras/evoman_framework/HEAD/evoman/images/EvoManSprites.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Evoman is a video game playing framework to be used as a testbed for optimization algorithms. 2 | 3 | A demo can be found here: https://www.youtube.com/watch?v=ZqaMjd1E4ZI 4 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /evoman/roles.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /loop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | experiment_name='individual_demo' 4 | 5 | while [ ! -f $experiment_name"/neuroended" ] 6 | do 7 | python optimization_specialist_demo.py 8 | done 9 | 10 | exit 0 11 | 12 | -------------------------------------------------------------------------------- /evoman/roles4.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /evoman/Base/SpriteConstants.py: -------------------------------------------------------------------------------- 1 | 2 | #Colors 3 | BLACK = (0, 0, 0) 4 | 5 | #Directions 6 | RIGHT = 1 7 | LEFT = 0 8 | 9 | #Movements types 10 | STANDING = 0 11 | 12 | START_RUNNING = 1 13 | 14 | RUNNING_STEP1 = 2 15 | RUNNING_STEP2 = 3 16 | 17 | JUMPING = 4 18 | 19 | SHOOTING = 6 20 | SHOOTING_JUMPING = 5 21 | 22 | HURTING = 7 23 | 24 | -------------------------------------------------------------------------------- /evoman/README.md: -------------------------------------------------------------------------------- 1 | ################################ 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # Author: Karine Miras # 4 | # karine.smiras@gmail.com # 5 | ################################ 6 | 7 | EvoMan is a framework for testing optimization algorithms in General Video Game Playing research field. The environment provides multiple 2D platform games to be run in several parameterized simulation modes. 8 | 9 | Needs: numpy and pygame 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /dummy_demo.py: -------------------------------------------------------------------------------- 1 | ################################ 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # Author: Karine Miras # 4 | # karine.smiras@gmail.com # 5 | ################################ 6 | 7 | # imports framework 8 | import sys, os 9 | 10 | from evoman.environment import Environment 11 | 12 | experiment_name = 'dummy_demo' 13 | if not os.path.exists(experiment_name): 14 | os.makedirs(experiment_name) 15 | 16 | # initializes environment with ai player using random controller, playing against static enemy 17 | env = Environment(experiment_name=experiment_name) 18 | env.play() 19 | 20 | -------------------------------------------------------------------------------- /evoman/controller.py: -------------------------------------------------------------------------------- 1 | ################################ 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # Author: Karine Miras # 4 | # karine.smiras@gmail.com # 5 | ################################ 6 | 7 | import numpy 8 | 9 | class Controller(object): 10 | 11 | def set(self, genome, n_inputs): 12 | pass 13 | 14 | def control(self, params, cont = None): 15 | 16 | left = numpy.random.choice([1,0]) 17 | right = numpy.random.choice([1,0]) 18 | jump = numpy.random.choice([1,0]) 19 | shoot = numpy.random.choice([1,0]) 20 | release = numpy.random.choice([1,0]) 21 | 22 | return [left, right, jump, shoot, release] 23 | -------------------------------------------------------------------------------- /human_demo.py: -------------------------------------------------------------------------------- 1 | ################################ 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # Author: Karine Miras # 4 | # karine.smiras@gmail.com # 5 | ################################ 6 | 7 | # imports framework 8 | import sys, os 9 | 10 | from evoman.environment import Environment 11 | 12 | experiment_name = 'test' 13 | 14 | if not os.path.exists(experiment_name): 15 | os.makedirs(experiment_name) 16 | 17 | # initializes environment with human player and static enemies 18 | for en in range(1, 9): 19 | env = Environment(experiment_name=experiment_name, 20 | enemymode='static', 21 | speed="normal", 22 | sound="on", 23 | fullscreen=True, 24 | use_joystick=True, 25 | playermode='human', 26 | visuals=True) 27 | env.update_parameter('enemies', [en]) 28 | env.play() 29 | 30 | -------------------------------------------------------------------------------- /evoman/Base/SpriteDefinition.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | 3 | from . import SpriteConstants 4 | 5 | 6 | class SpriteDefinition(object): 7 | """Contains the properties and methods to control a SpriteSheet structure""" 8 | 9 | def __init__(self, fileName, origin_X, origin_Y, width, height): 10 | self.SpriteSheet = pygame.image.load(fileName).convert() 11 | self.Origin_X = origin_X 12 | self.Origin_Y = origin_Y 13 | self.Width = width 14 | self.Height = height 15 | 16 | def getImage(self, steps_X, steps_Y): 17 | marginX = self.Width * steps_X 18 | marginY = self.Height * steps_Y 19 | 20 | image = pygame.Surface([self.Width, self.Height]).convert() 21 | 22 | image.blit(self.SpriteSheet, 23 | (0, 0), 24 | (marginX, 25 | marginY, 26 | self.Width, 27 | self.Height)) 28 | 29 | image.set_colorkey(SpriteConstants.BLACK) 30 | 31 | return image 32 | -------------------------------------------------------------------------------- /controller_generalist_demo.py: -------------------------------------------------------------------------------- 1 | ####################################################################################### 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # DEMO : perceptron neural network controller evolved by Genetic Algorithm. # 4 | # general solution for enemies (games) # 5 | # Author: Karine Miras # 6 | # karine.smiras@gmail.com # 7 | ####################################################################################### 8 | 9 | # imports framework 10 | import sys,os 11 | 12 | from evoman.environment import Environment 13 | from demo_controller import player_controller 14 | 15 | # imports other libs 16 | import numpy as np 17 | 18 | experiment_name = 'controller_generalist_demo' 19 | if not os.path.exists(experiment_name): 20 | os.makedirs(experiment_name) 21 | 22 | # Update the number of neurons for this specific example 23 | n_hidden_neurons = 0 24 | 25 | # initializes environment for multi objetive mode (generalist) with static enemy and ai player 26 | env = Environment(experiment_name=experiment_name, 27 | playermode="ai", 28 | player_controller=player_controller(n_hidden_neurons), 29 | speed="normal", 30 | enemymode="static", 31 | level=2) 32 | 33 | sol = np.loadtxt('solutions_demo/demo_all.txt') 34 | print('\n LOADING SAVED GENERALIST SOLUTION FOR ALL ENEMIES \n') 35 | 36 | # tests saved demo solutions for each enemy 37 | for en in range(1, 9): 38 | 39 | #Update the enemy 40 | env.update_parameter('enemies',[en]) 41 | 42 | env.play(sol) 43 | 44 | print('\n \n') 45 | -------------------------------------------------------------------------------- /controller_specialist_demo.py: -------------------------------------------------------------------------------- 1 | ####################################################################################### 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # DEMO : perceptron neural network controller evolved by Genetic Algorithm. # 4 | # specialist solutions for each enemy (game) # 5 | # Author: Karine Miras # 6 | # karine.smiras@gmail.com # 7 | ####################################################################################### 8 | 9 | # imports framework 10 | import sys, os 11 | 12 | from evoman.environment import Environment 13 | from demo_controller import player_controller 14 | 15 | # imports other libs 16 | import numpy as np 17 | 18 | experiment_name = 'controller_specialist_demo' 19 | if not os.path.exists(experiment_name): 20 | os.makedirs(experiment_name) 21 | 22 | # Update the number of neurons for this specific example 23 | n_hidden_neurons = 0 24 | 25 | # initializes environment for single objective mode (specialist) with static enemy and ai player 26 | env = Environment(experiment_name=experiment_name, 27 | playermode="ai", 28 | player_controller=player_controller(n_hidden_neurons), 29 | speed="normal", 30 | enemymode="static", 31 | level=2, 32 | visuals=True) 33 | 34 | 35 | # tests saved demo solutions for each enemy 36 | for en in range(1, 9): 37 | 38 | #Update the enemy 39 | env.update_parameter('enemies',[en]) 40 | 41 | # Load specialist controller 42 | sol = np.loadtxt('solutions_demo/demo_'+str(en)+'.txt') 43 | print('\n LOADING SAVED SPECIALIST SOLUTION FOR ENEMY '+str(en)+' \n') 44 | env.play(sol) 45 | -------------------------------------------------------------------------------- /evoman/roles2.tsx: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /evoman/roles3.tsx: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /optimization_dummy.py: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # DEMO : Neuroevolution - Genetic Algorithm neural network. # 4 | # Author: Karine Miras # 5 | # karine.smiras@gmail.com # 6 | ############################################################################### 7 | 8 | # imports framework 9 | import sys 10 | 11 | from evoman.environment import Environment 12 | from demo_controller import player_controller 13 | 14 | # imports other libs 15 | import numpy as np 16 | import os 17 | 18 | # runs simulation 19 | def simulation(env,x): 20 | f,p,e,t = env.play(pcont=x) 21 | return f 22 | 23 | # evaluation 24 | def evaluate(env, x): 25 | return np.array(list(map(lambda y: simulation(env,y), x))) 26 | 27 | 28 | def main(): 29 | # choose this for not using visuals and thus making experiments faster 30 | headless = True 31 | if headless: 32 | os.environ["SDL_VIDEODRIVER"] = "dummy" 33 | 34 | 35 | experiment_name = 'optimization_test' 36 | if not os.path.exists(experiment_name): 37 | os.makedirs(experiment_name) 38 | 39 | n_hidden_neurons = 10 40 | 41 | # initializes simulation in individual evolution mode, for single static enemy. 42 | env = Environment(experiment_name=experiment_name, 43 | enemies=[2], 44 | playermode="ai", 45 | player_controller=player_controller(n_hidden_neurons), # you can insert your own controller here 46 | enemymode="static", 47 | level=2, 48 | speed="fastest", 49 | visuals=False) 50 | 51 | 52 | # number of weights for multilayer with 10 hidden neurons 53 | n_vars = (env.get_num_sensors()+1)*n_hidden_neurons + (n_hidden_neurons+1)*5 54 | 55 | # start writing your own code from here 56 | 57 | 58 | 59 | if __name__ == '__main__': 60 | main() -------------------------------------------------------------------------------- /evoman/sensors.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | import struct 3 | import binascii 4 | 5 | # sensors for the controllers 6 | class Sensors(): 7 | 8 | 9 | def get(self, game): 10 | 11 | 12 | # calculates vertical and horizontal distances between sprites centers 13 | 14 | posx_p = game.player.rect.left +((game.player.rect.right - game.player.rect.left)/2) 15 | posy_p = game.player.rect.bottom +((game.player.rect.top - game.player.rect.bottom)/2) 16 | posx_e = game.enemy.rect.left +((game.enemy.rect.right - game.enemy.rect.left)/2) 17 | posy_e = game.enemy.rect.bottom +((game.enemy.rect.top - game.enemy.rect.bottom)/2) 18 | 19 | # pre-allocate values for the bullets 20 | param_values = [ posx_p-posx_e, posy_p-posy_e, game.player.direction, game.enemy.direction] + [0]*16 21 | 22 | # calculates vertical and horizontal distances between player and the center of enemy's bullets 23 | bullet_count = 0 24 | for i in range(0,len(game.enemy.twists)): 25 | if game.enemy.twists[i] != None: 26 | posx_be = game.enemy.twists[i].rect.left +((game.enemy.twists[i].rect.right - game.enemy.twists[i].rect.left)/2) 27 | posy_be = game.enemy.twists[i].rect.bottom +((game.enemy.twists[i].rect.top - game.enemy.twists[i].rect.bottom)/2) 28 | param_values[4 + bullet_count * 2] = posx_p - posx_be 29 | param_values[4 + bullet_count * 2 + 1] = posy_p - posy_be 30 | bullet_count+=1 31 | 32 | 33 | # applies several transformations to input variables (sensors) 34 | if game.inputscoded == "yes": 35 | 36 | types = struct.Struct('q q q q q q q q q q q q q q q q q q q q') # defines the data types of each item of the array that will be packed. (q=int, f=flo) 37 | packed_data = types.pack(*param_values) # packs data as struct 38 | coded_variables = binascii.hexlify(packed_data) # converts packed data to an hexadecimal string 39 | coded_variables = [coded_variables[i:i+2] for i in range(0, len(coded_variables), 2)] # breaks hexadecimal string in bytes. 40 | coded_variables = numpy.array(map(lambda y: int(y, 16), coded_variables)) # converts bytes to integer 41 | 42 | param_values = coded_variables 43 | 44 | 45 | self.sensors = param_values # defines sensors state 46 | 47 | 48 | return numpy.array(self.sensors) 49 | -------------------------------------------------------------------------------- /evoman/map3.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | eJzt1DkOwjAUhGFfhe0MYYcOkACxQ9jufwz+4lkaWS9ikUUDxSfLY2dSOHERQmijgy56KDJlfQwwxAjjjNnB7G084oTySRbnK6yxwRY76YyWpoGmzKdmYuMMcyxs3Xt/2l1DXbpbSaZ9uu+MC6644f5Bd1Xm7fl3/063/mv6nObvduuz8Xv2sjT3unPdS9++q6rO65Uz033e+gOljU6A 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 | -------------------------------------------------------------------------------- /solutions_demo/demo_4.txt: -------------------------------------------------------------------------------- 1 | -2.335073215241207922e-01 2 | -3.269523114297601118e-01 3 | -4.489887641351597569e-01 4 | 6.646502835925969244e-01 5 | -1.267248686507127520e-01 6 | 5.712602224987395338e-01 7 | -8.207548946574130255e-01 8 | 7.576276926725800109e-01 9 | -1.786865554539971424e-01 10 | -2.645032521108574564e-01 11 | 1.747228650397767424e-01 12 | 5.775595130380848374e-01 13 | -9.088601870163095509e-01 14 | -3.227107391539711934e-01 15 | -4.024320653196098441e-01 16 | 2.813125734425565572e-01 17 | 3.195621066971547908e-01 18 | -8.489397684933235322e-01 19 | 4.148725400069055436e-01 20 | 7.152304736057191192e-01 21 | -1.619832548353250523e-01 22 | 2.568755992916957887e-01 23 | 9.493883537893006430e-01 24 | 5.962846658706544289e-01 25 | 5.637233161638397494e-01 26 | -4.587142562135346768e-01 27 | -7.136249295668308790e-01 28 | 8.776545458635729435e-01 29 | 7.003445959136134213e-01 30 | 1.251831365398330398e-01 31 | -3.724337068039054177e-01 32 | 2.927570159316472687e-01 33 | 4.356182544210360774e-01 34 | 7.697193192292552943e-01 35 | 6.605653071776247387e-01 36 | -8.212558358369601574e-01 37 | 7.331810553551032505e-02 38 | -2.821537067218344852e-01 39 | -3.734444161902894521e-01 40 | -6.860499243693429783e-01 41 | -5.816785527458885330e-01 42 | 6.178055722230408886e-01 43 | 7.016175740842167663e-02 44 | 3.381503533998380107e-01 45 | -9.816993470354735685e-01 46 | -2.115542774309320251e-02 47 | 3.937764101385370363e-01 48 | -4.580726310074145768e-01 49 | 3.045077679123648906e-01 50 | -6.583344755717792651e-01 51 | 4.381756510383281178e-01 52 | 7.644735778259601489e-01 53 | 9.758085742787734329e-01 54 | 2.344229729720004318e-01 55 | 3.370328793838854864e-01 56 | 3.906669261619952760e-01 57 | 2.023100288248960155e-01 58 | -2.791512381199747761e-01 59 | -9.670307853094555206e-01 60 | -6.724307637665025705e-01 61 | 9.380554921915869038e-01 62 | 1.076738338010267970e-01 63 | 3.539340246961919512e-02 64 | -3.499399408126737665e-01 65 | 9.200349727678265310e-01 66 | 1.976408038793064925e-01 67 | -1.652716695593174911e-01 68 | 4.082781140515256979e-01 69 | -9.814863002211300369e-01 70 | -3.974409276545287639e-02 71 | -8.747615432220736675e-01 72 | 6.805297690719411818e-01 73 | 3.608491175237706905e-01 74 | 9.344932258192983898e-01 75 | 4.307192076835293371e-01 76 | 5.802187272885563907e-01 77 | 3.878639631036946422e-01 78 | 7.387108451150090627e-01 79 | 8.674309024472475205e-01 80 | 3.543064853750577115e-02 81 | -2.635429606854182705e-01 82 | 7.980317565957435466e-01 83 | -4.011505531629642185e-01 84 | 7.125373403098349545e-01 85 | -4.736466926401223798e-01 86 | 6.789411267537948103e-01 87 | 5.816318781186247122e-01 88 | 9.556853328294312444e-01 89 | 6.439779293178959918e-01 90 | -2.394027422023268237e-01 91 | -8.037543832638311958e-01 92 | -3.204877127832523875e-01 93 | 4.854195540704309142e-01 94 | 8.376685685244869006e-01 95 | -9.733052220931290854e-01 96 | -1.096242039954173908e-01 97 | -8.528340664281015560e-01 98 | 9.566094111132543709e-01 99 | 1.442475690777107467e-01 100 | -9.096470195282413407e-01 101 | 2.502512666061569302e-01 102 | -5.637992677760119697e-01 103 | -1.601778063334873270e-01 104 | -2.820012228710673252e-01 105 | -6.662039174007452491e-01 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_all.txt: -------------------------------------------------------------------------------- 1 | -4.305198696724163998e-01 2 | 1.839929042032597550e-01 3 | -9.116733312535161282e-01 4 | 1.782694406869373971e-01 5 | 3.593287183084019620e-01 6 | 9.983580423854088171e-01 7 | -7.853121183587241649e-01 8 | 5.741671757950901345e-01 9 | 9.262942267618945458e-01 10 | 6.291099066499228343e-01 11 | -6.850101769834040510e-01 12 | 1.652749963848942905e-02 13 | 3.992203199649695389e-01 14 | 9.321465461476088343e-01 15 | -5.355370492712014929e-01 16 | -3.872228223919498280e-01 17 | -8.363471288230481804e-01 18 | -4.486144259100577347e-01 19 | 1.710869735220164056e-01 20 | -8.416284545133432271e-01 21 | 9.839648166923908867e-01 22 | 1.337320001564084038e-01 23 | -7.246958538362653357e-01 24 | 2.757063756201609817e-01 25 | -3.907234586272527732e-01 26 | -7.176966154668722453e-01 27 | -3.034641750189916998e-01 28 | 4.810198435301313857e-01 29 | 3.506075661519902908e-01 30 | 1.878959023729693811e-01 31 | 8.420184321022554652e-01 32 | 2.928328371663326823e-01 33 | -4.722297532709185397e-02 34 | 6.904909040648521401e-01 35 | 3.893646626008817613e-02 36 | -3.247333507818610521e-01 37 | -4.661041773072109873e-01 38 | -7.625372129432794743e-01 39 | -5.973452868827129336e-01 40 | 6.133561993145559832e-01 41 | -8.687904107207091720e-01 42 | 8.193644820183703104e-01 43 | -2.051620460756329312e-01 44 | 9.768201265205713746e-01 45 | -7.330690934806971537e-01 46 | -1.130294695899638491e-01 47 | 2.310440326517075871e-01 48 | 7.510275310201448562e-01 49 | -7.872602553266976333e-01 50 | 8.625878996771723095e-01 51 | -2.811863244665773198e-01 52 | -9.051731420423612118e-01 53 | -4.008793691178134111e-01 54 | -3.721231186293609827e-01 55 | -6.826160048787766055e-01 56 | 8.540114883351854758e-01 57 | 4.543898472882361705e-01 58 | 4.796328591373004713e-01 59 | -7.522536568221247499e-01 60 | 2.372971002174970589e-01 61 | 5.214600874195696179e-01 62 | 2.742389211916247405e-01 63 | -5.609823281028807340e-01 64 | -2.317248806521110538e-02 65 | 2.842923160803996208e-01 66 | -9.019761445083458451e-01 67 | -5.209465861484792182e-01 68 | 3.573760343570786535e-01 69 | 2.330616878240927559e-01 70 | 1.059091945373458188e-03 71 | -2.599261949876336963e-01 72 | 5.073429623981506875e-01 73 | 7.867993667539081581e-01 74 | 6.228123680159964870e-01 75 | 6.845747806306445860e-02 76 | -1.410502806538371789e-01 77 | 1.014990996569844484e-01 78 | 9.385324587613093072e-01 79 | -1.248403780394085061e-01 80 | 6.943291068084394002e-01 81 | -7.700720708816084503e-01 82 | 3.620565687394039500e-02 83 | 7.906438234271344623e-01 84 | 4.606705687128767046e-01 85 | 5.522154750134715684e-01 86 | -1.165179475962554445e-01 87 | 3.033963001112471858e-01 88 | 1.499710640813514129e-01 89 | 9.983674069230474846e-01 90 | 4.415412438389589855e-01 91 | -9.523091527993305938e-01 92 | 4.721522774096298392e-01 93 | -9.506284939022768832e-02 94 | 5.982213321414484586e-01 95 | 5.968410216416306646e-01 96 | 7.405052213129392769e-01 97 | -7.675692838099665849e-01 98 | 9.645917449846572733e-01 99 | 4.721763638875866587e-01 100 | -2.163752358335713222e-01 101 | 5.943331909914726374e-01 102 | 5.398873217506163780e-01 103 | 5.484119234595616899e-01 104 | -5.458521571035002129e-01 105 | 1.856350093319645289e-01 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_5.txt: -------------------------------------------------------------------------------- 1 | -1.000000000000000000e+00 2 | -4.293571111671073970e-01 3 | 1.312429579262228974e-01 4 | 2.440981550621654228e-01 5 | -1.195700016460885806e-01 6 | 2.765798646415129625e-01 7 | 2.251538993775406006e-01 8 | 2.400847125288060047e-01 9 | 2.374061284172892528e-01 10 | 2.986744652742503447e-01 11 | -7.112921741298985912e-02 12 | -7.367213855461092475e-02 13 | 3.303404702695609263e-01 14 | 3.223468511346369025e-01 15 | -3.504139224120854101e-01 16 | -1.133791618007970597e-01 17 | 1.127942587639835237e-02 18 | 1.800067412120630594e-01 19 | 4.875529201724828482e-02 20 | 2.222426379271925101e-01 21 | 2.599023736431735898e-01 22 | 4.508078080257441611e-01 23 | 2.561405931112156198e-01 24 | 2.949351065147950424e-01 25 | -9.263843421718356841e-02 26 | 2.420668617913982190e-01 27 | -1.723882827130810702e-01 28 | -1.990775154648552481e-01 29 | 3.989102305036896778e-01 30 | -4.461073121398195229e-01 31 | -4.635944848591702083e-01 32 | 9.042528790757090040e-02 33 | -3.246663971962858719e-01 34 | 1.880410039465672534e-01 35 | -4.021576666758988061e-01 36 | -4.228405554339519368e-01 37 | 6.722345402054425989e-01 38 | 1.088616140419058215e-01 39 | 1.970344634287687566e-02 40 | -4.012188602611651556e-01 41 | -1.605026063107814829e-03 42 | -4.858270030382627613e-01 43 | -3.168487000227470096e-01 44 | 1.805758357225519806e-01 45 | 4.227150719317843142e-01 46 | 1.858894985673232303e-01 47 | 2.908426131309240215e-01 48 | 3.049995077514062736e-01 49 | -1.115694530352583924e-01 50 | 3.333303482257791162e-01 51 | 3.744049823152298950e-01 52 | -1.859551153938737433e-01 53 | -1.710302297171888974e-01 54 | 1.276124527734868314e-02 55 | -6.030492214386597993e-01 56 | 1.001155023416989143e-01 57 | -2.242948104781200269e-01 58 | 3.004456594676555570e-01 59 | -2.763035637901117836e-01 60 | 2.751142588017510549e-01 61 | 4.123141543220728567e-01 62 | -5.036290215510423884e-01 63 | 1.271440325907207680e-01 64 | -2.389028175798888209e-01 65 | -3.673692368989171786e-02 66 | -1.947133128337003721e-02 67 | -2.525702532858545846e-01 68 | -2.370458742495619008e-03 69 | 1.541991013552501122e-01 70 | 2.068372475813395339e-01 71 | -5.525818661446514346e-01 72 | 4.109093172232699542e-01 73 | -1.877213367819214329e-01 74 | 8.148211845617443772e-02 75 | -5.188792585673226987e-02 76 | 9.838459681128450263e-02 77 | 2.285964199650111772e-01 78 | 1.314347254263153186e-01 79 | 5.204970486523302284e-03 80 | -3.004472511058491335e-01 81 | -3.094000073518277660e-01 82 | 1.405855158107018055e-01 83 | 4.932628885871480628e-01 84 | -2.653244881312990522e-01 85 | 8.029481931213480750e-02 86 | -3.612574021749314496e-03 87 | 2.617693603110875511e-01 88 | 1.495531164564655180e-01 89 | 2.279286925566076649e-01 90 | 1.192524211568060655e-02 91 | -2.419340999889614541e-01 92 | -4.242999030158172147e-01 93 | -7.928097379735150885e-02 94 | -4.614358273854447523e-01 95 | 1.191099316200539548e-01 96 | -1.783383830950480975e-01 97 | -4.847830660615380927e-01 98 | -2.532762997715318765e-01 99 | -1.063742642041850955e-01 100 | 2.330519804376058324e-01 101 | -8.875760935564969145e-02 102 | 3.801028859424788742e-01 103 | -1.956746279525403698e-01 104 | -6.579982795005656637e-02 105 | -9.977949759219865156e-01 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_6.txt: -------------------------------------------------------------------------------- 1 | -1.000000000000000000e+00 2 | -4.698717526598942262e-01 3 | -9.708395502645726649e-02 4 | 1.735677985451941630e-02 5 | 2.887164814879246144e-01 6 | 8.782414726374841024e-03 7 | 3.382008440995863396e-01 8 | 3.841831434601273298e-01 9 | 2.279490052904271902e-04 10 | -1.173466468195162732e-01 11 | -2.393690268620803085e-01 12 | 5.169102019114338864e-01 13 | 3.559329633053420205e-01 14 | 9.823736877512240229e-02 15 | 1.204882491049904109e-01 16 | -5.911592613868127399e-02 17 | -3.018667481098151195e-01 18 | 5.717459984190600419e-01 19 | -9.508751372676110813e-02 20 | 1.624095106474035544e-01 21 | -5.763800880874949545e-02 22 | 2.594086966175377929e-01 23 | 1.574250669546412851e-01 24 | 1.667341652456500178e-01 25 | -8.629352689394736986e-02 26 | 2.938474794490952280e-01 27 | -4.281769965524361288e-01 28 | -8.775337859153500841e-02 29 | -8.419323626364824675e-02 30 | 1.679671998396565225e-01 31 | -2.505824740981710264e-01 32 | -9.173178614526808494e-02 33 | -7.852117087287180386e-01 34 | 2.633485827082538422e-01 35 | -4.185248249634421214e-01 36 | -2.944312890360397672e-01 37 | 1.543072135872461392e-01 38 | 2.319858352561024462e-02 39 | 2.620047179427000827e-01 40 | 7.976651739992887680e-02 41 | 3.239890999728720633e-01 42 | -4.390498429649163925e-01 43 | 5.748814027309223640e-01 44 | 3.722197680794339658e-01 45 | 1.645029837676153517e-01 46 | -1.441013642563483965e-01 47 | 1.132832629205083284e-03 48 | 6.720076930082108380e-01 49 | -1.533159396353225845e-01 50 | -2.935755596995346384e-01 51 | -4.314552835210337944e-01 52 | -3.502331720869050757e-02 53 | 2.022403865031064951e-01 54 | 3.117597503725164643e-01 55 | -6.866547115948797020e-02 56 | -4.534657259450681210e-01 57 | -1.550859932906895611e-01 58 | -1.918734678992845000e-01 59 | -2.907532932620655042e-01 60 | 2.775121949943220589e-01 61 | -1.226136058593562533e-01 62 | 1.945069662864468141e-01 63 | -4.308380416750292596e-01 64 | 2.486187571825139719e-01 65 | 9.250598840730132888e-02 66 | -1.928035740167824419e-01 67 | -2.040222184049018672e-01 68 | -2.529859316312303985e-01 69 | 2.757104948356980945e-01 70 | -6.083644573628907981e-01 71 | 2.151073577236186640e-01 72 | -1.787645137759051039e-01 73 | 4.160796558827288549e-02 74 | 2.434301061812983447e-01 75 | 1.398291216139814150e-02 76 | 6.479145767101465170e-01 77 | 1.095809096698579926e-01 78 | -7.770040437920562593e-02 79 | 2.896598896990623118e-01 80 | 2.398877931909782490e-01 81 | 3.601988937531958035e-01 82 | 2.698907524982989137e-01 83 | -2.534374043860758707e-01 84 | 1.486358040598496078e-01 85 | 5.968899581377153929e-01 86 | 2.863907058432672015e-01 87 | 2.131801400356279075e-01 88 | -3.142270883012929228e-01 89 | -3.377988033848425831e-01 90 | -2.129266822376543189e-01 91 | -3.852856684392850228e-01 92 | 4.040667031064889003e-01 93 | 1.260102166611452579e-01 94 | 1.654052529009484296e-01 95 | -4.950552814509624755e-02 96 | -8.316190593223657390e-02 97 | -4.380926734637567710e-02 98 | 1.899540605318358541e-02 99 | 4.576237133828450210e-01 100 | -3.042364593447599574e-01 101 | -3.313666460389991242e-01 102 | -3.714364981477586425e-01 103 | -2.599602087504853873e-02 104 | 2.856912863315009266e-01 105 | -7.754365013106804261e-01 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_7.txt: -------------------------------------------------------------------------------- 1 | -1.000000000000000000e+00 2 | 5.355361462085145297e-01 3 | 1.814289897976559263e-01 4 | 6.027787735989600382e-01 5 | 2.088682322259752255e-01 6 | 5.560948033945123381e-01 7 | -2.703554015496540952e-01 8 | -5.686039162984646289e-02 9 | -1.311190584045488772e-01 10 | 5.530098399381506991e-02 11 | 2.675928435592269533e-02 12 | -2.026810271246801409e-01 13 | -2.150823160823488456e-01 14 | -2.213020925879408130e-01 15 | -4.669102451115217378e-02 16 | 1.580012565257210289e-01 17 | 2.551569953473408203e-01 18 | 4.383996766250526367e-01 19 | 1.647875839244697382e-01 20 | -2.847668670038636107e-01 21 | -8.487089958115315302e-02 22 | -1.424801339945592493e-01 23 | 3.099984630436457556e-01 24 | -4.519287526875305772e-01 25 | -5.663951485285233234e-02 26 | 5.740437678115739573e-01 27 | -9.896598865423550384e-02 28 | -4.505098556740360499e-02 29 | 4.554513029048009587e-01 30 | -2.334779849055123035e-01 31 | -5.726319933651828897e-01 32 | 9.087013959587272871e-02 33 | -9.399088521508064398e-02 34 | -3.669259953746287772e-01 35 | 6.457834480412978362e-01 36 | -8.196378747906560291e-02 37 | 4.002881105992315280e-01 38 | 2.399536664929246277e-01 39 | 9.650313266552115743e-02 40 | -5.696663803008400473e-01 41 | -4.417740985121423325e-01 42 | -2.582646893510606168e-01 43 | 1.336054030491951039e-01 44 | -1.890703726562155684e-01 45 | 3.387768461587330471e-01 46 | 1.983692134069810764e-01 47 | 2.829031090625633293e-01 48 | 6.694889965696955159e-01 49 | 3.739773419463154891e-01 50 | 9.535069754516832530e-02 51 | 3.774490419845649702e-02 52 | 4.819615723767798482e-02 53 | -3.055991919986111166e-02 54 | 1.309060412441336030e-01 55 | 3.893125909404762108e-01 56 | -1.222109278637436569e-01 57 | -2.499656517107365639e-01 58 | 2.209795968255187648e-02 59 | 1.354384814970962525e-01 60 | 2.886054994620272929e-01 61 | -2.930979842360700860e-01 62 | -4.318725049178649966e-01 63 | -1.021954168423485909e-01 64 | 1.590013869050212747e-01 65 | 4.139773747120125691e-01 66 | 6.325130488522354155e-02 67 | -6.785103668225193063e-01 68 | 3.070460425459897724e-01 69 | -9.486528464255986060e-02 70 | -2.677255876881123875e-01 71 | -4.656014976532086291e-01 72 | -2.159046238152874664e-01 73 | 1.713189330497471019e-01 74 | 5.083504984955369288e-01 75 | 2.032123473760608923e-01 76 | -3.973805569440265195e-01 77 | -1.825232381915113389e-01 78 | -4.374229404698486423e-01 79 | 2.887622172805633380e-01 80 | -3.785127852429899520e-02 81 | 3.096906574221935937e-01 82 | 5.501171292716036110e-01 83 | 1.207242708786182284e-01 84 | -2.680519225887469936e-01 85 | -2.803207397358047359e-01 86 | -2.693631559104243678e-01 87 | -3.820120458491788051e-01 88 | -1.314791371134748088e-01 89 | 4.586015415677893170e-01 90 | 4.984752444296041696e-01 91 | 4.704642776136891413e-01 92 | 1.122229681548426172e-01 93 | 5.568656700285372629e-01 94 | -5.535579168896988256e-02 95 | 1.729429106155225548e-01 96 | -2.757508962256415702e-02 97 | 2.900223923448000396e-01 98 | -7.720633640543976828e-01 99 | 4.838350809776484351e-02 100 | -8.165763061940049805e-02 101 | 1.387431415432536369e-02 102 | 4.623945510676923110e-02 103 | -8.517438015470020496e-02 104 | 1.936090067155180755e-02 105 | -9.972329659041151428e-01 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_2.txt: -------------------------------------------------------------------------------- 1 | -1.000000000000000000e+00 2 | -4.828209633658692157e-01 3 | -3.208558080091941100e-01 4 | 5.120666623275705459e-02 5 | 4.411096889863109216e-01 6 | 4.060237952761409641e-01 7 | 1.750584774561255441e-01 8 | 1.332816169958273567e-01 9 | -6.813909994284018945e-02 10 | 3.748535823828798019e-01 11 | 3.967273530488419353e-01 12 | -2.198143562563584785e-01 13 | 4.681845829395080427e-01 14 | 4.043599692358753606e-01 15 | 3.560118035581642526e-01 16 | -5.217647981848853866e-02 17 | 2.007775041463628618e-01 18 | -1.259828811841428864e-01 19 | 2.805545896957988283e-01 20 | 2.885433131158136044e-01 21 | -6.697521404327005934e-02 22 | 3.176910949290916442e-01 23 | -3.172833794781901862e-01 24 | -1.081668977648486945e-03 25 | 6.334650389238233315e-01 26 | 2.346711561609144889e-02 27 | 1.178274385313880235e-01 28 | 7.569333904047301220e-02 29 | -3.631792116485303007e-02 30 | -6.774479295622437558e-02 31 | -3.715196762959985938e-02 32 | 2.563037661900596786e-01 33 | 1.474327562693324989e-01 34 | -3.056913836250558236e-01 35 | -2.876331140380910534e-01 36 | -4.567381866282546055e-01 37 | -2.571989071388390558e-02 38 | -1.147352043338922545e-01 39 | -1.931075021502449973e-01 40 | 3.476832163069345366e-02 41 | -2.766366793538127533e-01 42 | -3.767567867617337141e-02 43 | 2.850750127745821372e-01 44 | 5.705956735846673400e-01 45 | -3.255935898213934698e-01 46 | -4.299817672607976204e-01 47 | -3.415526534917274759e-01 48 | 4.200155072407809609e-01 49 | 3.880890552348651990e-01 50 | 3.395770588827504155e-01 51 | -3.443622896948119738e-01 52 | 2.254563819441217920e-01 53 | 3.238762105695576765e-01 54 | 4.930811881706549937e-01 55 | 2.518653062172554469e-01 56 | -3.085169292300960625e-02 57 | 3.920474448178990490e-01 58 | 2.355186517238666566e-01 59 | -3.526082992066886246e-01 60 | -1.745117705220761151e-02 61 | -1.301821712100907080e-01 62 | 1.166593297536090146e-01 63 | -3.309854422706736132e-01 64 | -8.045730431133550631e-02 65 | 5.164754531915004554e-01 66 | 3.283244269451594533e-01 67 | -3.470443331468634623e-02 68 | 5.254229790566756347e-02 69 | -8.302376182243964564e-02 70 | 4.743086148868188578e-01 71 | -6.426706620286985749e-02 72 | -1.543545099217791816e-01 73 | 9.187350224029537660e-02 74 | 1.526239316036185345e-01 75 | 1.121676224586797971e-01 76 | -7.529018828659569951e-02 77 | 4.543889162361772760e-01 78 | 2.112580252799179381e-01 79 | -4.662830495509240336e-02 80 | -2.589995843037459777e-01 81 | -5.216010697482481584e-01 82 | 3.704045980750955147e-01 83 | -2.467205788187304683e-01 84 | 1.130692626070486581e-02 85 | -5.845651523604493693e-01 86 | 3.888289659879398587e-03 87 | -1.647088572970769049e-01 88 | 1.736360256151835701e-01 89 | 2.300617200283530117e-01 90 | -2.978222905054223046e-01 91 | -4.674414755651373210e-01 92 | -4.650705778818944314e-01 93 | 7.089466339454868204e-02 94 | 1.622052218407568358e-01 95 | -1.196863955133640744e-01 96 | -5.779781428495058826e-01 97 | 2.962199059000716634e-03 98 | -3.205375238914061065e-01 99 | 5.061924912166956281e-01 100 | 1.426472134439600581e-01 101 | 8.650717443874915424e-02 102 | -2.676557858233954423e-01 103 | -3.002512209308912383e-01 104 | -4.034721917875954689e-01 105 | -9.417877746494868196e-01 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_8.txt: -------------------------------------------------------------------------------- 1 | -1.000000000000000000e+00 2 | 3.561472023038952384e-01 3 | -2.304856979116161331e-01 4 | -3.021719687337119931e-01 5 | 3.093805662045809868e-01 6 | -1.104877347942199717e-01 7 | 2.076934980736386827e-01 8 | 3.588399415873475690e-02 9 | -3.395661629269048354e-01 10 | -1.689806345341771654e-01 11 | -1.035021272601917286e-02 12 | 8.714291438830432807e-03 13 | -9.829124179665511829e-02 14 | 2.965124345014056306e-01 15 | -1.018206734706424421e-01 16 | 3.260651390695728513e-01 17 | 1.398099084849758200e-01 18 | -1.391148765333355686e-01 19 | 9.721385650824507230e-02 20 | -2.451524751620388909e-01 21 | -2.198646389563890802e-01 22 | 1.729820931563411934e-01 23 | 3.784017925175524599e-01 24 | 2.520674452833880294e-03 25 | 2.022553625053389315e-01 26 | 2.478692030774872213e-01 27 | 1.957868751451738790e-02 28 | 2.008280056479478382e-01 29 | 2.131830756872891142e-01 30 | 1.751722322220748140e-01 31 | -1.580375669540706046e-02 32 | -4.268730730385407630e-03 33 | 7.817491179282534328e-03 34 | 2.533113672061926835e-01 35 | 1.266029800034939867e-01 36 | -1.503125589841712573e-01 37 | 1.380923072548297936e-01 38 | 3.290591901128158137e-01 39 | 1.967007393265623461e-01 40 | -2.445140092397642684e-01 41 | 1.445967238327429405e-01 42 | -1.444094552900775652e-01 43 | -8.932106078395493642e-02 44 | 1.534793811581660894e-01 45 | 4.151431598162433345e-02 46 | -2.613401551765411890e-01 47 | -1.661194841329028671e-01 48 | -1.300056920989375309e-01 49 | 8.341144674586935259e-02 50 | 1.672796025628824623e-01 51 | -1.549053877526587741e-01 52 | -1.704922008445496906e-01 53 | -2.959133523500580565e-01 54 | 4.297931018800886793e-01 55 | -9.690265460688006829e-03 56 | 4.520484160254678585e-02 57 | 1.098187015887530996e-02 58 | 2.741546420029331577e-01 59 | -3.124881520909490729e-02 60 | -1.602675164761995508e-01 61 | -6.491678603612927034e-02 62 | -6.559776772018875712e-03 63 | -9.769689361938821426e-02 64 | -9.665468997019813213e-02 65 | 4.024595279577734830e-02 66 | -4.357063029783896091e-02 67 | 1.947254084818465514e-01 68 | 3.231827467129939069e-01 69 | 8.881811180793475202e-02 70 | -5.800880064120872426e-02 71 | -1.846081388065712037e-01 72 | 2.018587685773436669e-01 73 | 2.299075886080131081e-01 74 | -8.876979264766000910e-02 75 | 9.281163116564677962e-02 76 | -2.036776908414600351e-01 77 | 2.126350640695366945e-01 78 | 1.758612916766761347e-01 79 | 4.991101466786921487e-02 80 | -8.034835591265376831e-02 81 | -2.154809748636816458e-01 82 | 1.062608875337137798e-01 83 | -1.318074191431571271e-02 84 | 2.661904380490742045e-02 85 | -1.606824172516137517e-01 86 | -2.689810169699821119e-01 87 | 9.652843233478466956e-02 88 | 2.561190765968547889e-01 89 | 1.192581521740480183e-01 90 | -3.480538627041104404e-03 91 | -2.751365697296055401e-01 92 | -1.672533459171449965e-01 93 | -3.996094260804424203e-01 94 | 6.508206524914994517e-02 95 | 4.023901695349975105e-01 96 | -8.555305161922276830e-03 97 | -5.925928369141383271e-04 98 | 1.375775547697503653e-01 99 | -1.085914468719001019e-01 100 | 1.454876560229583782e-01 101 | -4.194644588241010497e-01 102 | -2.907374771913221467e-01 103 | -1.088138635020058365e-01 104 | -3.055160927303202101e-01 105 | -3.920487042627285312e-01 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_1.txt: -------------------------------------------------------------------------------- 1 | -1.000000000000000000e+00 2 | 1.407936195361622622e-01 3 | -1.285582543264502386e-01 4 | 2.290539410215178262e-01 5 | -8.030874498034462627e-02 6 | -9.622064735495039489e-02 7 | 3.384755420490687117e-02 8 | 2.269153463758968869e-01 9 | 4.605262001990400034e-01 10 | 2.346266869736804428e-01 11 | -3.515014212392431059e-01 12 | -5.108800290248622922e-01 13 | 2.454100270370600523e-01 14 | -1.179957986073475740e-01 15 | -4.942580621140438835e-01 16 | -5.450634201059632034e-01 17 | 3.742440861796543783e-01 18 | 1.409178961840695243e-01 19 | 8.394720957460263810e-02 20 | 3.873850012997460679e-01 21 | -3.013385507817897269e-01 22 | 4.175913934127237215e-02 23 | -2.968436960733996655e-01 24 | 2.504115263522274093e-01 25 | 4.104997748919678724e-01 26 | -2.476361425799001870e-01 27 | -1.131321083161431207e-01 28 | 3.286665205304604154e-01 29 | -9.788483951841597808e-02 30 | -2.791401035676811526e-01 31 | -2.074278730673355109e-01 32 | -5.398341954515609720e-01 33 | 1.640240662746998979e-01 34 | 3.189627305087449072e-01 35 | 9.124892614178714556e-02 36 | -1.297110615990704485e-01 37 | -2.550795468741896554e-01 38 | 2.122161989826453765e-01 39 | -1.565302363582626866e-03 40 | 5.059143424194849359e-02 41 | 5.868502352904489960e-01 42 | 4.658056383201479855e-01 43 | -2.930674613524147931e-01 44 | -1.115272991269609937e-02 45 | -2.079402730433735358e-01 46 | -3.210672060739578892e-01 47 | -5.073810522073161078e-01 48 | 1.011531923583953718e-01 49 | 1.412331001413955761e-02 50 | -3.150638127693130564e-01 51 | -3.862622460501485833e-01 52 | -2.596104719949596240e-02 53 | 3.160560497996238172e-01 54 | 4.306265981497453543e-01 55 | -5.332639732162730573e-01 56 | -5.428340028437556031e-01 57 | -3.940272748780419554e-01 58 | 7.289203078517014767e-02 59 | -8.940442466505998942e-02 60 | 4.577684965581387821e-01 61 | -3.934877635301334831e-01 62 | -3.599960580821491285e-01 63 | -2.839010885456007272e-02 64 | -4.004800226147915698e-02 65 | 2.668112582434523095e-01 66 | -4.277815910382094799e-02 67 | 3.246573531123558842e-01 68 | -2.221177260650653018e-01 69 | -7.658834100476769047e-02 70 | 1.271083551837089154e-01 71 | 1.365160804998786226e-01 72 | -1.542730545421862054e-01 73 | -6.834117121866829792e-02 74 | -4.076127814904949298e-02 75 | -4.005167927287656138e-01 76 | -4.385117900785809875e-01 77 | -2.347399762632998987e-01 78 | -2.362132140065004715e-01 79 | 8.207624197814730738e-02 80 | 2.908174131065649481e-01 81 | -4.894123371495914254e-01 82 | 3.981021939783551122e-01 83 | -3.413694033731544675e-01 84 | -1.671372313767089945e-01 85 | -5.721507152380340688e-01 86 | 1.492194145433505259e-01 87 | -4.443347050702409762e-01 88 | 1.786284262889387686e-01 89 | -3.503451534743139140e-02 90 | 3.108487452674447704e-01 91 | -4.112608553113196175e-01 92 | 8.009841898630962187e-02 93 | 4.035627686065613728e-01 94 | -3.129784731593825142e-02 95 | 4.466658877140770034e-01 96 | 4.187686973172053406e-01 97 | -2.665038599081738235e-01 98 | -1.557907139052726042e-01 99 | -3.181529188562560728e-01 100 | -4.350391943543346907e-02 101 | 1.686779746877836716e-03 102 | 3.908611237128165605e-01 103 | -8.500146029752940480e-02 104 | 6.265437930633462882e-01 105 | 8.444511926144371294e-02 106 | -------------------------------------------------------------------------------- /solutions_demo/demo_3.txt: -------------------------------------------------------------------------------- 1 | -1.000000000000000000e+00 2 | -6.091400483395815746e-01 3 | 9.094860309035329715e-02 4 | 4.099774434375756949e-01 5 | -1.115005646386124927e-01 6 | 3.159928480460408862e-01 7 | -2.726349487871058686e-01 8 | 9.870283270102930828e-02 9 | 2.305868115892424908e-01 10 | 6.552273455432128246e-02 11 | -1.602860856163603742e-01 12 | -6.227301975966866854e-01 13 | -2.360296685180764131e-01 14 | 3.822866177440992219e-01 15 | 5.953358625849471814e-02 16 | -2.582370125918271864e-01 17 | -2.431465475852632174e-01 18 | -4.876183333980846912e-01 19 | -5.649362788836805732e-02 20 | -4.903982794827504987e-01 21 | -3.267418894840448118e-01 22 | 6.134566052982313167e-01 23 | -2.309082599571375960e-01 24 | 5.317824922514027830e-02 25 | 2.277398553399270220e-01 26 | -3.838648516573197611e-01 27 | -1.025162112535409065e-01 28 | 5.138180923554109825e-01 29 | 5.080024555166142708e-01 30 | 2.763991915821167322e-01 31 | 1.773470068773430608e-01 32 | -2.144314298560075216e-01 33 | 5.071563184902567745e-01 34 | -1.893420151261684392e-01 35 | 3.275400229141509773e-02 36 | 2.095870278344347248e-01 37 | -1.535383207118536930e-01 38 | -8.317299664039425056e-02 39 | -2.078599768873066189e-01 40 | -5.444762250688958694e-02 41 | -2.557994192080562113e-01 42 | 9.544122134991664397e-02 43 | 2.292886054684375452e-01 44 | 6.333272455404159729e-01 45 | -4.738024627559835750e-02 46 | -1.984239898543910807e-01 47 | -3.507358460213437779e-01 48 | 5.107992875123642529e-01 49 | -9.178160255845309312e-02 50 | -9.527573128587837892e-02 51 | -2.865600714690593742e-01 52 | -1.206554645889672261e-01 53 | 7.495284160130230577e-02 54 | 2.020791229578621645e-02 55 | -4.316729349606651667e-01 56 | -4.069539321714205071e-01 57 | 4.495487220808984385e-02 58 | 3.890824006402974211e-01 59 | 1.664620870095998573e-01 60 | 4.482088053051608290e-01 61 | 3.517083441374553310e-01 62 | -2.071932702447859265e-01 63 | -4.065600104609554677e-01 64 | 4.130698350106301597e-01 65 | -8.451803417196837587e-02 66 | 1.790174025887553491e-02 67 | -1.746810580149396885e-01 68 | 1.109950478105980326e-02 69 | 2.593812484685372732e-01 70 | -1.087964984030477811e-01 71 | -3.214233624043059678e-01 72 | -1.750405797324918744e-01 73 | -1.242574951573142406e-01 74 | 3.884736797476717185e-01 75 | -6.125156410509662031e-02 76 | 3.786239854333562915e-01 77 | -5.076536620043681225e-01 78 | -1.954603171065246170e-01 79 | 3.870882066373775299e-01 80 | 2.052494258503864688e-01 81 | -9.948957543771611012e-02 82 | -5.973857825804103350e-02 83 | 7.450449492649854899e-02 84 | -2.507595951857590211e-01 85 | 1.352128327037182554e-01 86 | -4.143378825334089743e-01 87 | 2.698986242275590031e-01 88 | -4.528187492060898323e-01 89 | -8.711062642746847384e-02 90 | -6.319487809179459570e-02 91 | -2.948721359180107582e-01 92 | 6.641815969095056504e-02 93 | -4.948583173261683621e-02 94 | 2.577174365723825522e-01 95 | 3.346797545083493586e-02 96 | 1.681046877778457904e-01 97 | -1.166300104010407068e-01 98 | -3.630744153955783871e-01 99 | 6.460175667978577119e-01 100 | 7.910718089506449391e-02 101 | 7.034374102899815240e-02 102 | -4.858241280775395937e-02 103 | -1.348752750692363833e-01 104 | -2.858251340350318470e-01 105 | -8.929390358783892978e-01 106 | -------------------------------------------------------------------------------- /evoman/map2.tmx: -------------------------------------------------------------------------------- 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 | eJy11EcOAjEMheG5Ab13uBy99957uTL/JlJkwURAWHyajJ9lRV4k6DhOCB544YMfAQR/zCKIIqydY4gjgeQXmfpX3xHGmGCKGeZYvKm59cvZK6yxwRY77HF4U3Pr/+Teeqafbdxbz/Sz7XurzNa+X2Wf7LuIEsqooIoa6miImqlXzm6ihTY66KKHPgaiZuqVs4eGHeo1U6+cvTTsUK+ZeuXsI04444IrbrjjIWqmXjXzH2+Uymy+UTJLIY0Mssghj4KF7AlW5nVa 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 | -------------------------------------------------------------------------------- /evoman/map4.tmx: -------------------------------------------------------------------------------- 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 | eJyl1EdwVmUYhuHzx2gaCiqo4EIRSAXTFLEROgTSo7RQBEsaNuyyUDrSQgJWkKILOyiWFASUIqILey9pKBYU1IUdvDJxJv+KTRbXzD3znXnnWZ34yCBIIJEkkkmhP/GdfEsjKwiCIQxlGMMZwUhGMZoxZDOWceSQSx75FFBIEcVB+92LKNVllFNBJbO4nhu4kZu4mdncwq3cxu3cwZ3cxd3MCdrvtt2v0quopobVrOF+HuBBHuJhHmEt63iU9WxgI5t4jMfDdtfqOuppYBuvsp0d7OQ1XmcXu9nDXt5gH2+yn7d4O2x3o26imRZaOcA3fMtBvuN7fuBHDvETP3OYI/zCr/wWtjsqFATRxBBLHF04mVPoSjdO5TROpzs9OIMzOYue9OLsUMfuVJ1GOhlkcgEXMrDtOwZxMZdwKZdxOYPJYghDGcbwUMfuCXoik5hMCVOYyjSmcxUzmMnVXMO1XEcpZZRTQWXY7nv0vcxlHvNZwEIWsZgl3MdSlrGcFaykilVUU8PqsN1P6Cd5iqd5hmd5js1s4XleYCsv8hIv8wq11FFPA9vCdr+j3+U93ucDPuQjPuYTPuUzPucLvuQrvqaRJpppoTVs9+/6D/7kL/7mH/7lKMcIIoIgRAQnEMmJnEQU0cQQS1xEx+5z9Ln05jz60Jd+xJNAIkkkk0J/BnA+qaSRTgaZER27R+sxZDOWceSQSx75FFBIEcVcwZWMZwITmcRkSv7f3dn/6PHe/gMGQZqA 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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.py[cod] 3 | *$py.class 4 | 5 | # Visual Studio Code 6 | .vscode/ 7 | 8 | # Byte-compiled / optimized / DLL files 9 | __pycache__/ 10 | *.py[cod] 11 | *$py.class 12 | 13 | # C extensions 14 | *.so 15 | 16 | # Distribution / packaging 17 | .Python 18 | build/ 19 | develop-eggs/ 20 | dist/ 21 | downloads/ 22 | eggs/ 23 | .eggs/ 24 | lib/ 25 | lib64/ 26 | parts/ 27 | sdist/ 28 | var/ 29 | wheels/ 30 | share/python-wheels/ 31 | *.egg-info/ 32 | .installed.cfg 33 | *.egg 34 | MANIFEST 35 | 36 | # PyInstaller 37 | # Usually these files are written by a python script from a template 38 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 39 | *.manifest 40 | *.spec 41 | 42 | # Installer logs 43 | pip-log.txt 44 | pip-delete-this-directory.txt 45 | 46 | # Unit test / coverage reports 47 | htmlcov/ 48 | .tox/ 49 | .nox/ 50 | .coverage 51 | .coverage.* 52 | .cache 53 | nosetests.xml 54 | coverage.xml 55 | *.cover 56 | *.py,cover 57 | .hypothesis/ 58 | .pytest_cache/ 59 | cover/ 60 | 61 | # Translations 62 | *.mo 63 | *.pot 64 | 65 | # Django stuff: 66 | *.log 67 | local_settings.py 68 | db.sqlite3 69 | db.sqlite3-journal 70 | 71 | # Flask stuff: 72 | instance/ 73 | .webassets-cache 74 | 75 | # Scrapy stuff: 76 | .scrapy 77 | 78 | # Sphinx documentation 79 | docs/_build/ 80 | 81 | # PyBuilder 82 | .pybuilder/ 83 | target/ 84 | 85 | # Jupyter Notebook 86 | .ipynb_checkpoints 87 | 88 | # IPython 89 | profile_default/ 90 | ipython_config.py 91 | 92 | # pyenv 93 | # For a library or package, you might want to ignore these files since the code is 94 | # intended to run in multiple environments; otherwise, check them in: 95 | # .python-version 96 | 97 | # pipenv 98 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 99 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 100 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 101 | # install all needed dependencies. 102 | #Pipfile.lock 103 | 104 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 105 | __pypackages__/ 106 | 107 | # Celery stuff 108 | celerybeat-schedule 109 | celerybeat.pid 110 | 111 | # SageMath parsed files 112 | *.sage.py 113 | 114 | # Environments 115 | .env 116 | 117 | # Spyder project settings 118 | .spyderproject 119 | .spyproject 120 | 121 | # Rope project settings 122 | .ropeproject 123 | 124 | # mkdocs documentation 125 | /site 126 | 127 | # mypy 128 | .mypy_cache/ 129 | .dmypy.json 130 | dmypy.json 131 | 132 | # Pyre type checker 133 | .pyre/ 134 | 135 | # pytype static type analyzer 136 | .pytype/ 137 | 138 | # Cython debug symbols 139 | cython_debug/ 140 | 141 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 142 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 143 | 144 | # User-specific stuff 145 | .idea/**/workspace.xml 146 | .idea/**/tasks.xml 147 | .idea/**/usage.statistics.xml 148 | .idea/**/dictionaries 149 | .idea/**/shelf 150 | 151 | # AWS User-specific 152 | .idea/**/aws.xml 153 | 154 | # Generated files 155 | .idea/**/contentModel.xml 156 | 157 | # Sensitive or high-churn files 158 | .idea/**/dataSources/ 159 | .idea/**/dataSources.ids 160 | .idea/**/dataSources.local.xml 161 | .idea/**/sqlDataSources.xml 162 | .idea/**/dynamic.xml 163 | .idea/**/uiDesigner.xml 164 | .idea/**/dbnavigator.xml 165 | 166 | # Gradle 167 | .idea/**/gradle.xml 168 | .idea/**/libraries 169 | 170 | # Gradle and Maven with auto-import 171 | # When using Gradle or Maven with auto-import, you should exclude module files, 172 | # since they will be recreated, and may cause churn. Uncomment if using 173 | # auto-import. 174 | # .idea/artifacts 175 | # .idea/compiler.xml 176 | # .idea/jarRepositories.xml 177 | # .idea/modules.xml 178 | # .idea/*.iml 179 | # .idea/modules 180 | # *.iml 181 | # *.ipr 182 | 183 | # CMake 184 | cmake-build-*/ 185 | 186 | # Mongo Explorer plugin 187 | .idea/**/mongoSettings.xml 188 | 189 | # File-based project format 190 | *.iws 191 | 192 | # IntelliJ 193 | out/ 194 | 195 | # mpeltonen/sbt-idea plugin 196 | .idea_modules/ 197 | 198 | # JIRA plugin 199 | atlassian-ide-plugin.xml 200 | 201 | # Cursive Clojure plugin 202 | .idea/replstate.xml 203 | 204 | # SonarLint plugin 205 | .idea/sonarlint/ 206 | 207 | # Crashlytics plugin (for Android Studio and IntelliJ) 208 | com_crashlytics_export_strings.xml 209 | crashlytics.properties 210 | crashlytics-build.properties 211 | fabric.properties 212 | 213 | # Editor-based Rest Client 214 | .idea/httpRequests 215 | 216 | # Android studio 3.1+ serialized cache file 217 | .idea/caches/build_file_checksums.ser 218 | -------------------------------------------------------------------------------- /demo_controller.py: -------------------------------------------------------------------------------- 1 | # the demo_controller file contains standard controller structures for the agents. 2 | # you can overwrite the method 'control' in your own instance of the environment 3 | # and then use a different type of controller if you wish. 4 | # note that the param 'controller' received by 'control' is provided through environment.play(pcont=x) 5 | # 'controller' could contain either weights to be used in the standard controller (or other controller implemented), 6 | # or even a full network structure (ex.: from NEAT). 7 | from evoman.controller import Controller 8 | import numpy as np 9 | 10 | 11 | def sigmoid_activation(x): 12 | return 1./(1.+np.exp(-x)) 13 | 14 | 15 | # implements controller structure for player 16 | class player_controller(Controller): 17 | def __init__(self, _n_hidden): 18 | self.n_hidden = [_n_hidden] 19 | 20 | def set(self,controller, n_inputs): 21 | # Number of hidden neurons 22 | 23 | if self.n_hidden[0] > 0: 24 | # Preparing the weights and biases from the controller of layer 1 25 | 26 | # Biases for the n hidden neurons 27 | self.bias1 = controller[:self.n_hidden[0]].reshape(1, self.n_hidden[0]) 28 | # Weights for the connections from the inputs to the hidden nodes 29 | weights1_slice = n_inputs * self.n_hidden[0] + self.n_hidden[0] 30 | self.weights1 = controller[self.n_hidden[0]:weights1_slice].reshape((n_inputs, self.n_hidden[0])) 31 | 32 | # Outputs activation first layer. 33 | 34 | 35 | # Preparing the weights and biases from the controller of layer 2 36 | self.bias2 = controller[weights1_slice:weights1_slice + 5].reshape(1, 5) 37 | self.weights2 = controller[weights1_slice + 5:].reshape((self.n_hidden[0], 5)) 38 | 39 | def control(self, inputs, controller): 40 | # Normalises the input using min-max scaling 41 | inputs = (inputs-min(inputs))/float((max(inputs)-min(inputs))) 42 | 43 | if self.n_hidden[0]>0: 44 | # Preparing the weights and biases from the controller of layer 1 45 | 46 | # Outputs activation first layer. 47 | output1 = sigmoid_activation(inputs.dot(self.weights1) + self.bias1) 48 | 49 | # Outputting activated second layer. Each entry in the output is an action 50 | output = sigmoid_activation(output1.dot(self.weights2)+ self.bias2)[0] 51 | else: 52 | bias = controller[:5].reshape(1, 5) 53 | weights = controller[5:].reshape((len(inputs), 5)) 54 | 55 | output = sigmoid_activation(inputs.dot(weights) + bias)[0] 56 | 57 | # takes decisions about sprite actions 58 | if output[0] > 0.5: 59 | left = 1 60 | else: 61 | left = 0 62 | 63 | if output[1] > 0.5: 64 | right = 1 65 | else: 66 | right = 0 67 | 68 | if output[2] > 0.5: 69 | jump = 1 70 | else: 71 | jump = 0 72 | 73 | if output[3] > 0.5: 74 | shoot = 1 75 | else: 76 | shoot = 0 77 | 78 | if output[4] > 0.5: 79 | release = 1 80 | else: 81 | release = 0 82 | 83 | return [left, right, jump, shoot, release] 84 | 85 | 86 | # implements controller structure for enemy 87 | class enemy_controller(Controller): 88 | def __init__(self, _n_hidden): 89 | # Number of hidden neurons 90 | self.n_hidden = [_n_hidden] 91 | 92 | def control(self, inputs,controller): 93 | # Normalises the input using min-max scaling 94 | inputs = (inputs-min(inputs))/float((max(inputs)-min(inputs))) 95 | 96 | if self.n_hidden[0]>0: 97 | # Preparing the weights and biases from the controller of layer 1 98 | 99 | # Biases for the n hidden neurons 100 | bias1 = controller[:self.n_hidden[0]].reshape(1,self.n_hidden[0]) 101 | # Weights for the connections from the inputs to the hidden nodes 102 | weights1_slice = len(inputs)*self.n_hidden[0] + self.n_hidden[0] 103 | weights1 = controller[self.n_hidden[0]:weights1_slice].reshape((len(inputs),self.n_hidden[0])) 104 | 105 | # Outputs activation first layer. 106 | output1 = sigmoid_activation(inputs.dot(weights1) + bias1) 107 | 108 | # Preparing the weights and biases from the controller of layer 2 109 | bias2 = controller[weights1_slice:weights1_slice + 5].reshape(1,5) 110 | weights2 = controller[weights1_slice + 5:].reshape((self.n_hidden[0],5)) 111 | 112 | # Outputting activated second layer. Each entry in the output is an action 113 | output = sigmoid_activation(output1.dot(weights2)+ bias2)[0] 114 | else: 115 | bias = controller[:5].reshape(1, 5) 116 | weights = controller[5:].reshape((len(inputs), 5)) 117 | 118 | output = sigmoid_activation(inputs.dot(weights) + bias)[0] 119 | 120 | # takes decisions about sprite actions 121 | if output[0] > 0.5: 122 | attack1 = 1 123 | else: 124 | attack1 = 0 125 | 126 | if output[1] > 0.5: 127 | attack2 = 1 128 | else: 129 | attack2 = 0 130 | 131 | if output[2] > 0.5: 132 | attack3 = 1 133 | else: 134 | attack3 = 0 135 | 136 | if output[3] > 0.5: 137 | attack4 = 1 138 | else: 139 | attack4 = 0 140 | 141 | return [attack1, attack2, attack3, attack4] 142 | -------------------------------------------------------------------------------- /evoman/map1.tmx: -------------------------------------------------------------------------------- 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 | eJzt0ddXzgEcx/EfualIkr2LUGZG9qqMyorsmexNJE0rhOxN5oVRFzLu5E7+LK/O8ZzzO13kOKfuXLzO7/P8nu/zvnmigiDoRleiOnjP6xIE0Z4xxNKdHsTRk3h6kUBvEulDX/rRnwEMZBCDGfKn29ntofYwhjOCJJIZyShSGM0YxpJKGuMYzwQmMonJpIfaU+ypTGM6GcxgJrOYzRzmtv6G+SxgIYvIJItsFrMk1F5qLyOHXPJYzgpWsorV5LOGtRSwjvVsYCOb2MyWUHurvY3t7GAnheyiiN3sYS/72M8BDnKIwxzhKMc4HmqfsE9SzClOU8IZSjlLGeVUUEkV1ZzjPBe4yCVqQu3L9hWuUss1rnODOm5yi9vc4S73uM8DHvKIxzzhaaj9zH5OPS94ySte84a3rf+Xuyyyeefzez7wkQYa29xE2p+8b+IzX/jKtza34f3dd838aOcm0v7ppoVf7dz+6460O6r3v/339m9AHmsJ 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 | -------------------------------------------------------------------------------- /optimization_coevolution_demo.py: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # EvoMan FrameWork - V1.0 2016 # 3 | # DEMO : Neuroevolution - Genetic Algorithm with neural network. # 4 | # Author: Karine Miras # 5 | # karine.smiras@gmail.com # 6 | ############################################################################### 7 | 8 | # imports framework 9 | import sys 10 | 11 | from evoman.environment import Environment 12 | from demo_controller import player_controller, enemy_controller 13 | 14 | # imports other libs 15 | import time 16 | import numpy as np 17 | from math import fabs,sqrt 18 | import glob, os 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | class environm(Environment): 27 | 28 | # implements fitness function 29 | def fitness_single(self): 30 | 31 | if self.contacthurt == "player": 32 | return 0.9*(100 - self.get_enemylife()) + 0.1*self.get_playerlife() - np.log(self.get_time()) 33 | 34 | else: 35 | return 0.9*(100 - self.get_playerlife()) + 0.1*self.get_enemylife() - np.log(self.get_time()) 36 | 37 | 38 | experiment_name = 'co_demo' 39 | if not os.path.exists(experiment_name): 40 | os.makedirs(experiment_name) 41 | 42 | n_hidden_neurons = 10 43 | 44 | # initializes simulation for coevolution evolution mode. 45 | env = environm(experiment_name=experiment_name, 46 | enemies=[2], 47 | playermode="ai", 48 | enemymode="ai", 49 | player_controller=player_controller(n_hidden_neurons), 50 | enemy_controller=enemy_controller(n_hidden_neurons), 51 | level=2, 52 | speed="fastest") 53 | 54 | 55 | env.state_to_log() # checks environment state 56 | 57 | 58 | #### Optimization for controller solution (best genotype/weights for perceptron phenotype network): Ganetic Algorihm ### 59 | 60 | ini = time.time() # sets time marker 61 | 62 | 63 | # genetic algorithm params 64 | 65 | run_mode = 'train' # train or test 66 | 67 | # number of weights for multilayer with 10 hidden neurons 68 | n_vars = (env.get_num_sensors()+1)*n_hidden_neurons + (n_hidden_neurons+1)*5 69 | 70 | dom_u = 1 71 | dom_l = -1 72 | npop = 100 73 | gens = 100 74 | mutation = 0.2 75 | last_best = 0 76 | 77 | 78 | # runs simulation 79 | def simulation(env,x1,x2): 80 | f,p,e,t = env.play(pcont=x1,econt=x2) 81 | return f 82 | 83 | # normalizes 84 | def norm(x,pfit_pop): 85 | 86 | if ( max(pfit_pop) - min(pfit_pop) ) > 0: 87 | x_norm = ( x - min(pfit_pop) )/( max(pfit_pop) - min(pfit_pop) ) 88 | else: 89 | x_norm = 0 90 | 91 | if x_norm <= 0: 92 | x_norm = 0.0000000001 93 | return x_norm 94 | 95 | 96 | # evaluation 97 | def evaluate(x1,x2): 98 | return np.array(list(map(lambda y: simulation(env,y,x2), x1))) 99 | 100 | 101 | # tournament 102 | def tournament(pop,fit_pop): 103 | c1 = np.random.randint(0,pop.shape[0], 1) 104 | c2 = np.random.randint(0,pop.shape[0], 1) 105 | if fit_pop[c1] > fit_pop[c2]: 106 | return pop[c1][0] 107 | else: 108 | return pop[c2][0] 109 | 110 | 111 | # limits 112 | def limits(x): 113 | 114 | if x>dom_u: 115 | return dom_u 116 | elif x