-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrandomAgent.py
27 lines (24 loc) · 899 Bytes
/
randomAgent.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
import interface
import random
#painting = 278.238216667 out of 400 or 0.6955955417
#language = 18.1 out of 400 or 0.04525
#photobashing = 291.273528387 out of 400 or 0.728183821
#stories = 109.984779144 out of 400 or 0.02890049406
#dessert = 95.3720238095 out of 400 or 0.238
#Total = 680.7623105835 out of 2000 or 0.3403811553
myInterface = interface.TestInterface()
currentProblem = myInterface.GetNextProblem()
scores = []
while not currentProblem is None:
#Solve problems
for i in range(0, 10):#10 random activations
submission = []
for i in range(0, currentProblem.numArguments):
if i==currentProblem.keyArgument:
submission.append(random.choice(currentProblem.knowledgeBase))
else:
submission.append(random.random())
currentProblem.ActivateFunction(submission)
scores.append(currentProblem.Score())
currentProblem = myInterface.GetNextProblem()
print (sum(scores))