code to use sofcr?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13045
    Med_Support
    Moderator
    lefevertim

    Hi,
    Trying to figure out what I need to write into my current drug discrim program to utilize sofcr? I tried creating an array for the responses/time but when I run the data through sofcr it’s not working (just get flat lines)…… The sofcr manual is a little sparse with how to go about doing this, not sure if I need to use specific array naming for sofcr to pick it up. Any help would be appreciated.

     

    Thanks,
    Tim

    #13046
    Med_Support
    Moderator
    Gary Bamberger
    \***************************************************
    \     INCREMENT TIME T FOR IRT AND EVENT ARRAY
    \***************************************************
    S.S.6,
    S1,
    #START: ---> S2
    
    S2,     \ Increment T every 10 ms
    0.01": ADD T ---> SX
    
     
    
    \**************************************************************
    \ ADD A STEP 0 ELEMENT TO ARRAY C FOR EACH LEFT LEVER RESPONSE
    \**************************************************************
    S.S.7,
    S1,
    #START: ---> S2
    
    S2,
    #R^LeftLever: IF I <= 10000 [@Cont, @ArrayFull]
    @Cont: SET C(I) = T + 0.10, T = 0; ADD I;
    IF I <= 10000 [@Cont, @ArrayFull]
    @Cont: SET C(I) = -987.987 ---> SX
    @Full: ---> S1
    @Full: ---> S1
    
     
    
    \***************************************************************
    \ ADD A STEP 1 ELEMENT TO ARRAY C FOR EACH RIGHT LEVER RESPONSE
    \***************************************************************
    S.S.8,
    S1,
    #START: ---> S2
    
    S2,
    #R^RightLever: IF I <= 10000 [@Cont, @ArrayFull]
    @Cont: SET C(I) = T + 0.11, T = 0; ADD I;
    IF I <= 10000 [@Cont, @ArrayFull]
    @Cont: SET C(I) = -987.987 ---> SX
    @Full: ---> S1
    @Full: ---> S1
    

     

    You will notice that there is two differences between S.S.7 and S.S.8:

    1) S.S.7 is looking for an input on the LeftLever
    S.S.8 is looking for an input on the RightLever

    2) S.S.7 uses the SoftCR code 0.10
    S.S.8 uses the SoftCR code 0.11

     

    The number before the decimal point is the Time Component.  It is keeping track of how much time has passed since the previous data element was recorded.

    The first number after the decimal point is the Control Code that you wish to mark.  In this case the Control Code is .1 which is a Step/Response.

    The second number after the decimal point is the Trace Line that you wish to use.  There are 10 Trace Lines (0 through 9).

    All SoftCR Control Codes work this way.

    .1 = Step
    .2 = Pip
    .3 = Reset Trace Pen
    .5 = Lower Event Pen
    .6 = Raise Event Pen

    Trace Pens are in the upper window and Event Pens are in the lower window.

     

    Please feel free to let me know if you have any other questions or need more info.

    #13050
    Med_Support
    Moderator
    paulocmayer

    Dear Gary,

    Is there a way to have two different pens in the same curve using softcr?
    I am using a schedule of reinforcement + punishment on the same lever and I would like to see the moment these different events happened. I’ve tried using different codes ex: .1 for response; .2 for reinforcer (so far everything was ok on the curve); however to have the punishment shown I’ve tried using .3 .4 .5 .6 or .11 .12 .21 .22 and it didn’t work.

    Thank you
    Paulo

    #13052
    Med_Support
    Moderator
    Gary Bamberger

    Hello Paulo,
    If I understand you correctly you want to have two trace pens in the upper window.  The first trace pen shows the response .10 and reinforcement .20 and the second trace pen shows punishments.  I don’t know the criteria for a punishment, but the following should work:

    \*****************************************************
    \ ADD A STEP 1 ELEMENT TO ARRAY C FOR EACH PUNISHMENT
    \*****************************************************
    S.S.8,
    S1,
    #START: ---> S2
    
    S2,     \ Wait for punishment signal
    #Z1: IF I <= 10000 [@Cont, @ArrayFull]
    @Cont: SET C(I) = T + 0.11, T = 0; ADD I;
    IF I <= 10000 [@Cont, @ArrayFull]
    @Cont: SET C(I) = -987.987 ---> SX
    @Full: ---> S1
    @Full: ---> S1
    

    So the .1 is the Step and the second number after the decimal point (1) is the Trace Pen to use.  0.11 adds a Step to Trace Pen 1.

    I hope that this helps.  Please let me know if I can help you in any other way.

    Best Regards,
    Gary

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.