Пример #1
0
def closest_to_16():
    game_para = [0.5, 0, 1, 0.2]
    total_turns = 100
    total_res = 500
    pop = []

    types2 = [[0, 0, 0, 0], [1, 0, 1, 0], [1, 0, 0, 0], [0, 0, 0, 1],
              [0, 0, 1, 0], [0, 0, 1, 1], [0, 1, 0, 0], [0, 1, 0, 1],
              [0, 1, 1, 0], [0, 1, 1, 1], [1, 0, 0, 1], [1, 0, 1, 1],
              [1, 1, 0, 0], [1, 1, 0, 1], [1, 1, 1, 0], [1, 1, 1, 1]]

    for i in range(34):
        pop.append(
            Strategy.M2_2(total_turns, [
                random.random(),
                random.random(),
                random.random(),
                random.random()
            ]))
    for t in types2:
        pop.append(Strategy.M2_2(total_turns, t))

    #print("********************************")
    r = Replicator(game_para, total_turns, total_res, pop)
    r.play_days(100, "all closest", total_res, 0.1)
Пример #2
0
def diff_memory_types():
	game_para=[0.5, 0, 1, 0.2]
	total_turns=100
	total_res=500
	pop=[]

	types2=[[0,0,0,0],[0,0,0,1],[0,0,1,0],[0,0,1,1],[0,1,0,0],[0,1,0,1],[0,1,1,0],[0,1,1,1],
					[1,0,0,0],[1,0,0,1],[1,0,1,0],[1,0,1,1],[1,1,0,0],[1,1,0,1],[1,1,1,0],[1,1,1,1]
					]
	types1=[[0,0],[0,1],[1,0],[1,1]]

	for i in range(5):
		for t in types1:
			pop.append(Strategy.M1(total_turns,t))
			pop.append(Strategy.M1(total_turns,t))
		for t in types2:
			pop.append(Strategy.M2(total_turns,t))
			pop.append(Strategy.M2_2(total_turns,t))

	r=Replicator(game_para,total_turns,total_res,pop)
	r.play_days(500,"types",total_res)