-
Notifications
You must be signed in to change notification settings - Fork 0
/
FullRun.py
36 lines (31 loc) · 1009 Bytes
/
FullRun.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
import Geometry
import numpy as np
import pandas as pd
import time
import FindTheorems
# Do a few general constructions
triangle = Geometry.GeometricCollection()
triangle.make_triangle()
while triangle.do_all_tasks():
triangle.forget_some_tasks(100)
print "Finished randomly constructing"
# Now recreate this construction for general triangles to see if the rule holds
start = time.clock()
dfs = []
fails = 0
for i in range(10000):
random_triangle = Geometry.RandomTriangle()
try:
random_triangle.construct_point(triangle.objects[-1].name)
dfs.append(pd.DataFrame.from_dict(random_triangle.data, orient='index').T)
except AttributeError:
fails += 1
df = pd.concat(dfs)
end = time.clock()
print "\n{} constructions complete".format(df.shape[0])
print "Total time {} secs.".format(end - start)
solutions = FindTheorems.solutions_from_data(df)
print np.stack(solutions, axis=1)
print '\n'
for s in solutions:
FindTheorems.determine_type_of_relation(s, df.columns)