I have the following excerpt from the mackworth clock test code:
<trial GeneralSkipTimes>
/ ontrialbegin = [
if ( values.current_event_num <= values.total_skip_events)
values.skip_time = values.avg_event_interval*values.current_event_num + rand(-1*values.max_event_offset, values.max_event_offset)
else
values.skip_time = values.total_runtime
...
insert(counter.SkipEvent_Time, values.skip_time, values.current_event_num)
This excerpt generates the pseudo-random times for the skipping of the Mackworth clock and stores it in the SkipEvent_Time counter. The variables used in the calculation of the skip times are pre-defined in an earlier portion of the code.
Now, I want to add another variable called sign_time. I want the values of sign time to be always let's say 0 to 3 seconds before the values of the skip time. I tried simply entering another line inside the if-statement for what values.sign_time would be, and also adding a SignEvent_Time counter to store the respective sign times. This looks something like the following:
<trial GeneralSkipTimes>
/ ontrialbegin = [
if ( values.current_event_num <= values.total_skip_events)
values.skip_time = values.avg_event_interval*values.current_event_num + rand(-1*values.max_event_offset, values.max_event_offset)
values.sign_time = values.skip_time - rand(0,3000)
else
values.skip_time = values.total_runtime
values.sign_time = values.total_runtime
...
insert(counter.SkipEvent_Time, values.skip_time, values.current_event_num);
insert(counter.SignEvent_Time, values.sign_time, values.current_event_num);
Is this even possible to do? Or am I not using the if-else-statement correctly here? I am assuming like in any other programming language that you can have multiple lines of code within if-else-statements. Am I missing maybe a delineator? I know this doesn't work, I've already tried it. But I'd like to know if the error lies in this particular section of the code, or some place else. Maybe someone can give me some insights here.
Thanks
-pprat