Skip to content

Commit

Permalink
branched out to multiobjective
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrejb committed Apr 5, 2017
1 parent c496396 commit f061ab5
Show file tree
Hide file tree
Showing 35 changed files with 5 additions and 1,479 deletions.
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,3 @@ ENV/
.ropeproject

*.png

EA/results/03041650/0/

EA/results/03041656/0/

EA/results/03041656/1/

EA/results/03041708/0/
12 changes: 5 additions & 7 deletions EA/fitness.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ def evaluate_deck_by_wins(individual):
decklist = genome_to_decklist(individual)
filename = "candidate.dck"
write_decklist(ct.CARD_DIRECTORY + filename, decklist)
wins = [0]*len(ct.OPPONENTS)
for counter, opponent in enumerate(ct.OPPONENTS):
wins = 0
for opponent in 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[counter] += int(result[3])
wins += int(result[3])
p.wait()
for i in range(len(ct.OPPONENTS)):
wins[i] = (wins[i] / float(number_of_matches)) * 100
wins = [round(x, 2) for x in wins]
return tuple(wins) # MUST BE TUPLE!
fitness = (wins / float(number_of_matches)) * 100
return fitness, # MUST BE TUPLE!
58 changes: 0 additions & 58 deletions EA/results/03041656/03041656.txt

This file was deleted.

58 changes: 0 additions & 58 deletions EA/results/03041708/03041708.txt

This file was deleted.

43 changes: 0 additions & 43 deletions EA/results/03041708/1/0.dck

This file was deleted.

43 changes: 0 additions & 43 deletions EA/results/03041708/1/1.dck

This file was deleted.

43 changes: 0 additions & 43 deletions EA/results/03041708/1/2.dck

This file was deleted.

43 changes: 0 additions & 43 deletions EA/results/03041708/1/3.dck

This file was deleted.

43 changes: 0 additions & 43 deletions EA/results/03041708/1/4.dck

This file was deleted.

Loading

0 comments on commit f061ab5

Please sign in to comment.