first genetic algo bot

This commit is contained in:
Barak Michener 2017-12-29 17:05:18 -08:00
parent 7c429fb0eb
commit 5256ff7091
5 changed files with 129 additions and 3 deletions

View file

@ -1,6 +1,7 @@
import math
import random
import matplotlib.pyplot as plt
import matrixbot
BACKLOG_COST = 25
SUPPLY_COST = 5
@ -100,8 +101,22 @@ def main():
global SUPPLY_COST
global BACKLOG_COST
g = variableRequestGenerator(TURNS, 8, 14)
#chain = [StupidAI(12), PlayerChain("Manufacturer", 12), Base()]
chain = [PlayerChain("me", 12), LessStupidAI(12), LessStupidAI(12), LessStupidAI(12), Base()]
#chain = [PlayerChain("Manufacturer", 12), Base()]
#chain = [PlayerChain("me", 12), LessStupidAI(12), LessStupidAI(12), LessStupidAI(12), Base()]
mb1 = matrixbot.MatrixBot([ 0.29963248, 0.08142691, -0.86641011, 0.23675042, 0.7086182 ,
-0.06441882, 0.03062067, -1.18299915, 0.68115478, 0.16068485,
-1.7178326 , -0.29003603, -0.83202861, 1.73222139, -1.98878473,
-0.96036021, 0.65793096, 1.50552035, -1.18544224, 0.03207729,
0.78074126, -0.91446605, 2.92469872, 0.48680479, -0.34067442],
[-0.07150818, -0.10019835, -0.02610447, -0.02049193, 0.42415006], 12)
mb2 = matrixbot.MatrixBot([ 0.29963248, 0.08142691, -0.86641011, 0.23675042, 0.7086182 ,
-0.06441882, 0.03062067, -1.18299915, 0.68115478, 0.16068485,
-1.7178326 , -0.29003603, -0.83202861, 1.73222139, -1.98878473,
-0.96036021, 0.65793096, 1.50552035, -1.18544224, 0.03207729,
0.78074126, -0.91446605, 2.92469872, 0.48680479, -0.34067442],
[-0.07150818, -0.10019835, -0.02610447, -0.02049193, 0.42415006], 12)
chain = [mb1, PlayerChain("me", 12), mb2, Base()]
import pdb; pdb.set_trace()
turn = 0
total_sold = 0
history = []