![]() |
|
#1
|
|||
|
|||
|
running experimental trials
i recently created a makeshift balance board apparatus which was to be used as part of an experiment for a visuo-motor psychology experiment. after alot of trial, error, and some invaluable advice from the folks on this forum, i finally got the physics of the experiment running, but now i'm having difficulty getting the experiment to run as a series of trials.
this is the framework i'm going off of: Code:
def experiment(): yield participantInfo() yield loadWorld() yield prePhase() yield testPhase() yield postPhase() viztask.schedule(experiment) Code:
experiment_data = open(str(id) + '_experiment_data.txt','w') #write participant data to file data = "Participant ID: %s\tName: %s\tGender: %s\n\n" % (id,name,gender) experiment_data.write(data) right now, i have a loop set in the pre phase: Code:
trials = [10]
#for loop for trials
for trial in trials:
global isDone
isDone = False
trialCount = 1
global writeData
def isIn():
inThere = 0
if abs(ball.getPosition()[0]) < TARGET_REGION:
inThere = 1
data = '%d' % trialCount
data = data + str(round(viz.tick(),3))
data = data + '\t%d\n' % inThere
experiment_data.write(data)
Code:
while isDone is False:
startTime=viz.tick()
global elapsedTime
elapsedTime = viz.tick() - startTime
if abs(ball.getPosition()[0]) > BARLENGTH/2:
ball.setPosition((CENTERPOS[0],CENTERPOS[1]+5,CENTERPOS[2]))
trialCount = trialCount+1
isDone = True
any help would be greatly appreciated, thanks in advance. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Update scripts while running? | pcatalano | Vizard | 2 | 02-10-2011 01:29 PM |
| How to Hide Console when running from shell? | Renato Lima | Vizard | 3 | 11-18-2010 04:03 PM |
| Problem running Vizard | Jerry | Vizard | 4 | 03-06-2008 01:11 PM |
| Problems running R3 and R2.5 on the same computer | cade_mccall | Vizard | 5 | 09-05-2006 12:26 PM |
| running scripts without the IDE showing | hotspur1 | Vizard | 7 | 10-30-2003 11:36 AM |