# if nested??? [1 Attachment]

3 messages
Open this post in threaded view
|

## if nested??? [1 Attachment]

 Hello everyone, I am currently working on a project in which I think I have to put a series of nested if, which I have not been able to solve. I will put the problem and how I made the sentences which do not work.    If your strategy k was 6, and there was interaction, you will keep your strategy the same, otherwise you will subtract -1 from your strategy.  If your strategy k was -5, and there was interaction, your strategy will remain the same, otherwise +1 will be added to your strategy.  If the agent's strategy k is between 1 and 5, and hub interaction, then +1 will be added to reinforce its strategy otherwise it will be subtracted -1 from its strategy.    If the agent's strategy is between 0 to -4, and there was interaction, then -1 will be subtracted from his strategy, if the opposite happens then +1 will be added to his strategy.    I put it in the following way         if [k] of receptor = 6 [          set k 6        ]        if [k] of receptor = -5 [          set k -5        ]        if ([k] of receptor > 0) and ([k] of receptor < 6) [          set k k + 1        ]        if ([k] of receptor <= 0) and ([k] of receptor > (0 - 5)) [          set k k - 1        ]       if ([k] of receptor <= 0) [          set k k + 1        ]        if ([k] of receptor > 0) [          set k k - 1        ]            I will be very grateful if you could help me