コード例 #1
0
ファイル: train.py プロジェクト: rhedshi/cs181-final-project
import visualize
import sys

if sys.argv < 2:
	raise "Need agent name"

agentName = sys.argv[1]
repeats = 50
pattern = "python pacman.py -T SrcTeam -p %s -m 1000 -q"
values = [[	agentName ] * repeats]
visualize.savePlots("plots/train-%s.pdf" % agentName,[visualize.plotFinalScores(*visualize.compareFinalScores(pattern, *values, n=5), fmt="%s")])
コード例 #2
0
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning) 

import visualize


pattern = "python -W ignore pacman.py -T SrcTeam -p %s -m 1000 -q"
values = [[
	"GoodBadCapsuleDistanceAgent"
	, "SeededGoodBadCapsuleDistanceAgent"
	, "LocalNeighborhoodAgent"
	, "SeededLocalNeighborhoodAgent"
	, "GhostPositionAgent"
	, "SafeAgent"
	, "BadGhostAgent"
	, "CapsuleAgent"
	, "GhostAgent"
	, "AnyGhostAgent"
]]

n = 10
visualize.savePlots("plots/agents-trajectories.pdf",[visualize.plotScores(*visualize.compareScores(pattern, *values), fmt="%s")])
visualize.savePlots("plots/agents-finals.pdf",[visualize.plotFinalScores(*visualize.compareFinalScores(pattern, *values, n=n, seeds=range(1,n+1)), fmt="%s")])