-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
51 lines (37 loc) · 900 Bytes
/
test.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import robots_core
from robots_core.strategy import *
from robots_core.graph import *
import numpy as np
from scipy import sparse
from spektral.data.utils import to_disjoint
def get_XAE():
g = robots_core.RobotsGame( 30 )
b = g.board()
print( b.cell( 0, 0 ) )
print( b.get_stringified_representation() )
graph = DenseGraph( g )
X = np.asarray( graph.x )
print( X.shape )
A = np.asarray( graph.a )
print( A.shape )
E = np.asarray( graph.e )
print( E.shape )
#print( A )
return X, A, E
Xs = []
As = []
Es = []
for i in range( 0, 2 ):
X, A, E = get_XAE()
Xs.append( X )
As.append( A )
Es.append( E )
x, a, e, i = to_disjoint( Xs, [sparse.coo_matrix(a) for a in As], Es )
#np.set_printoptions(threshold=np.inf)
print( x.shape )
print( a.shape )
print( e.shape )
print( e )
#spy( a )
#for sample in a:
# print( sample )