-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDrawPlayerMove.py
More file actions
33 lines (29 loc) · 897 Bytes
/
DrawPlayerMove.py
File metadata and controls
33 lines (29 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from BaseCode.Game import Game
import matplotlib.pyplot as plt
import sys
import os
def main(path, player):
"""
Showing player move point by plot
:param path: path of rcg files
:param player: number of player [-11, -1] for left team and [1, 11] for right team
"""
p_pos = []
for f in os.listdir(path)[:1]:
g = Game.read_log(os.path.join(path, f))
for c in g.cycles():
p_pos.append(c.players()[player].pos())
plt.xlim(-55, +55)
plt.ylim(-34, +34)
import numpy as np
t = np.arange(len(p_pos))
plt.scatter([x.x() for x in p_pos], [x.y() for x in p_pos], s=1, c=t)
plt.show()
if __name__ == "__main__":
path = '/home/nader/workspace/robo/icjai/unmark/'
player = 11
if len(sys.argv) > 1:
path = sys.argv[1]
if len(sys.argv) > 2:
player = int(sys.argv[2])
main(path, player)