multiple inputs with conditional statements

MEDState Notation Repository Forums Coding Help Archive multiple inputs with conditional statements

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13145
    Med_Support
    Moderator
    S.Temple12

    wont let me complile this state set, but i dont know how else to code it. The general idea is to create a light that blinks for 5 seconds, then animal has those 5 seconds plus an additional 2 to press the button in order to get a reward. dont worry about the reward counters or latency timers, i will put those in later its the basic setup that i need help with.

    s1,
      #z8:--->s2
    
    
    s2,
      .01":on ^RightLight--->s3
    
    s3,
      .5":off ^RightLight; add b--->s4
    
    s4,
      .5": if b=10[@true, @false]
          @true:set b=0--->s1
          @false:--->s2
    
    #r2: z1;z7\ needs reward counter and latency timer
    #r1: z12;\needs error counter and latency timer
    1: add t;
        if t<=2[@cont, @omission] @cont:--->s2
           @omission--->s1\needs counter
    

    thanks alot

    #13146
    Med_Support
    Moderator
    Gary Bamberger

    I’m not 100% certain what you are trying to do from your brief description.  You have responses (#R2 and #R1) in the code that don’t arrow to anywhere and two timed inputs in the same State.  I’ve provided some sample code below, but like I said I’m not 100% certain that it is what you are trying to do.

    S.S.1,  \ Control Blinking Light
    S1,
    #Z8: ---> S2
    
    S2,
    0.01": ON ^RightLight ---> S3
    
    S3,
    0.5": OFF ^RightLight; ADD B ---> S4
    
    S4,
    0.5": IF B = 10 [@True, @False]
    @True: SET B = 0 ---> S1
    @False: ---> S2
    
     
    
    S.S.2,  \ Look for Response
    S1,
    #Z8: ---> S2
    
    S2,
    #R2: Z1; Z7
    #R1: Z12
    7": ---> S1
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.