Skip to content

Commit

Permalink
Multi modal optimization implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlbion committed Apr 3, 2017
1 parent 64aa10b commit 2623d53
Show file tree
Hide file tree
Showing 35 changed files with 1,478 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,11 @@ ENV/
.ropeproject

*.png

EA/results/03041650/0/

EA/results/03041656/0/

EA/results/03041656/1/

EA/results/03041708/0/
11 changes: 6 additions & 5 deletions EA/fitness.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ def evaluate_deck_by_wins(individual):
decklist = genome_to_decklist(individual)
filename = "candidate.dck"
write_decklist(ct.CARD_DIRECTORY + filename, decklist)
wins = 0
for opponent in ct.OPPONENTS:
wins = [0]*len(ct.OPPONENTS)
for counter, opponent in enumerate(ct.OPPONENTS):
cmd = build_cmd(filename, opponent, ct.MATCHES_PER_OPPONENT)
p = subprocess.Popen(cmd, cwd=ct.FORGE_PATH, stdout=subprocess.PIPE)
for line in p.stdout:
line = line.decode("utf-8").strip()
if 'Match result' in line:
result = line.split(' ')
wins += int(result[3])
wins[counter] += int(result[3])
p.wait()
fitness = (wins / float(number_of_matches)) * 100
return fitness, # MUST BE TUPLE!
for i in range(len(ct.OPPONENTS)):
wins[i] = (wins[i] / float(number_of_matches)) * 100
return tuple(wins) # MUST BE TUPLE!
58 changes: 58 additions & 0 deletions EA/results/03041656/03041656.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Experiment log:
Mutation rate: 0.2
Crossover rate: 0.7
Number of generations: 2
Number of matches pr opponent: 2
Number of opponents: 6
Opponents: ['GB-sealed-opponent.dck', 'UWg-sealed-opponent.dck', 'RG-sealed-opponent1.dck', 'BGw-sealed-opponent.dck', 'UR-sealed-opponent.dck', 'RW-sealed-opponent.dck']
Total number of matches: 240
Time to complete: 462.15056562423706
Avg time per match: 1.9256273567676545
Strongest overall individual: 16.666666666666664
Topscore for each generation:
8.333333333333332, 16.666666666666664,
Median score for each generation:
0.0, 0.0,
Worst score for each generation:
0.0, 0.0,
Overall best deck:
Alley Evasion
Dawnfeather Eagle
Revoke Privileges
Aether Swooper
Dispersal Technician
Take into Custody
Vedalken Blademaster
Vengeful Rebel
Fen Hauler
Chandra, Torch of Defiance
Freejam Regent
Kari Zev, Skyship Raider
Aethertorch Renegade
Hijack
Commencement of Festivities
Druid of the Cowl
Wily Bandar
Daredevil Dragster
Foundry Assembler
Renegade Freighter
Verdant Automaton
Plains
Mountain
Swamp
Mountain
Forest
Forest
Forest
Island
Plains
Island
Mountain
Plains
Mountain
Island
Swamp
Forest
Island
Plains
Swamp
58 changes: 58 additions & 0 deletions EA/results/03041708/03041708.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Experiment log:
Mutation rate: 0.2
Crossover rate: 0.7
Number of generations: 2
Number of matches pr opponent: 2
Number of opponents: 6
Opponents: ['GB-sealed-opponent.dck', 'UWg-sealed-opponent.dck', 'RG-sealed-opponent1.dck', 'BGw-sealed-opponent.dck', 'UR-sealed-opponent.dck', 'RW-sealed-opponent.dck']
Total number of matches: 240
Time to complete: 445.8772974014282
Avg time per match: 1.8578220725059509
Strongest overall individual: 50.0
Topscore for each generation:
50.0, 50.0,
Median score for each generation:
0.0, 0.0,
Worst score for each generation:
0.0, 0.0,
Overall best deck:
Deft Dismissal
Audacious Infiltrator
Efficient Construction
Bastion Inventor
Failed Inspection
Take into Custody
Vedalken Blademaster
Vengeful Rebel
Cruel Finality
Fortuitous Find
Renegade's Getaway
Kari Zev's Expertise
scrapper champion
Embraal Gear-Smasher
Wrangle
Elegant Edgecrafters
Druid of the Cowl
Unlicensed Disintegration
Filigree Familiar
Implement of Combustion
Plains
Plains
Plains
Island
Forest
Mountain
Island
Plains
Island
Swamp
Island
Island
Forest
Plains
Plains
Island
Forest
Plains
Swamp
Plains
43 changes: 43 additions & 0 deletions EA/results/03041708/1/0.dck
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[metadata]
Name=candidate
[Main]
Deft Dismissal
Audacious Infiltrator
Efficient Construction
Bastion Inventor
Failed Inspection
Take into Custody
Vedalken Blademaster
Vengeful Rebel
Cruel Finality
Fortuitous Find
Renegade's Getaway
Kari Zev's Expertise
scrapper champion
Embraal Gear-Smasher
Wrangle
Elegant Edgecrafters
Druid of the Cowl
Unlicensed Disintegration
Filigree Familiar
Implement of Combustion
Plains
Plains
Plains
Island
Forest
Mountain
Island
Plains
Island
Swamp
Island
Island
Forest
Plains
Plains
Island
Forest
Plains
Swamp
Plains
43 changes: 43 additions & 0 deletions EA/results/03041708/1/1.dck
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[metadata]
Name=candidate
[Main]
Deft Dismissal
Audacious Infiltrator
Efficient Construction
Bastion Inventor
Failed Inspection
Take into Custody
Vedalken Blademaster
Vengeful Rebel
Cruel Finality
Fortuitous Find
Renegade's Getaway
Kari Zev's Expertise
scrapper champion
Embraal Gear-Smasher
Wrangle
Elegant Edgecrafters
Druid of the Cowl
Unlicensed Disintegration
Filigree Familiar
Implement of Combustion
Plains
Plains
Plains
Island
Forest
Mountain
Island
Plains
Island
Swamp
Island
Island
Forest
Plains
Plains
Island
Forest
Plains
Swamp
Plains
43 changes: 43 additions & 0 deletions EA/results/03041708/1/2.dck
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[metadata]
Name=candidate
[Main]
Deft Dismissal
Audacious Infiltrator
Aether Theorist
Dispersal Technician
Dispersal Technician
Negate
Lost Legacy
Ovalchase Daredevil
Cruel Finality
Fen Hauler
Maulfist Squad
Resourceful Return
Chandra, Torch of Defiance
Aethertorch Renegade
Embraal Gear-Smasher
Hijack
Wrangle
Elegant Edgecrafters
Druid of the Cowl
Silkweaver Elite
Foundry Assembler
Reservoir Walker
Mountain
Mountain
Island
Swamp
Forest
Mountain
Mountain
Swamp
Mountain
Island
Forest
Island
Plains
Swamp
Island
Mountain
Island
Mountain
43 changes: 43 additions & 0 deletions EA/results/03041708/1/3.dck
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[metadata]
Name=candidate
[Main]
Vengeful Rebel
Swamp
Efficient Construction
Forest
Plains
Swamp
Swamp
Plains
Workshop Assistant
Filigree Familiar
Countless Gears Renegade
Forest
Silkweaver Elite
Embraal Gear-Smasher
Plains
Forest
Mountain
Foundry Assembler
Island
Mountain
Unlicensed Disintegration
Island
Druid of the Cowl
Plains
Plains
Swamp
Ovalchase Daredevil
Swamp
Aether Theorist
Island
Forest
Lost Legacy
Wily Bandar
Mountain
Consulate Turret
Audacious Infiltrator
Island
Plains
Chandra, Torch of Defiance
Plains
43 changes: 43 additions & 0 deletions EA/results/03041708/1/4.dck
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[metadata]
Name=candidate
[Main]
Vengeful Rebel
Swamp
Efficient Construction
Forest
Plains
Swamp
Swamp
Plains
Workshop Assistant
Filigree Familiar
Countless Gears Renegade
Forest
Silkweaver Elite
Embraal Gear-Smasher
Plains
Forest
Mountain
Foundry Assembler
Island
Mountain
Unlicensed Disintegration
Island
Druid of the Cowl
Plains
Plains
Swamp
Ovalchase Daredevil
Swamp
Aether Theorist
Island
Forest
Lost Legacy
Wily Bandar
Mountain
Consulate Turret
Audacious Infiltrator
Island
Plains
Chandra, Torch of Defiance
Plains
Loading

0 comments on commit 2623d53

Please sign in to comment.