can you add probability to a for loop?
I have a very long and complex fitness function that I want to add even more complexity to, and I’m wondering if I can shortcut it.
The basic idea is that an individual has to choose between two patches to forage in and the patches can now have a varying probability, either high or low, of finding food.
I want the combination of probabilities to be different from each other, that is
p1 = prob of finding food in patch 1 = hi or lo
p2 = prob of finding food in patch 2 = hi or lo
(p1,p2) combinations
30% chance of (hi,lo)
25% chance of (hi,hi)
25% chance of (lo,lo)
20% chance of (lo,hi)
The most straight forward way would just be adding it up
total fitness Fd = 0.3(F1) + 0.25(F2) + 0.25(F3) + 0.2(F4)
My code for fitness is already very long with only one combination of finding food probabilities. Is there a way I could do a for loop with these combinations and add in that probability or do I have to go the long way around?I have a very long and complex fitness function that I want to add even more complexity to, and I’m wondering if I can shortcut it.
The basic idea is that an individual has to choose between two patches to forage in and the patches can now have a varying probability, either high or low, of finding food.
I want the combination of probabilities to be different from each other, that is
p1 = prob of finding food in patch 1 = hi or lo
p2 = prob of finding food in patch 2 = hi or lo
(p1,p2) combinations
30% chance of (hi,lo)
25% chance of (hi,hi)
25% chance of (lo,lo)
20% chance of (lo,hi)
The most straight forward way would just be adding it up
total fitness Fd = 0.3(F1) + 0.25(F2) + 0.25(F3) + 0.2(F4)
My code for fitness is already very long with only one combination of finding food probabilities. Is there a way I could do a for loop with these combinations and add in that probability or do I have to go the long way around? I have a very long and complex fitness function that I want to add even more complexity to, and I’m wondering if I can shortcut it.
The basic idea is that an individual has to choose between two patches to forage in and the patches can now have a varying probability, either high or low, of finding food.
I want the combination of probabilities to be different from each other, that is
p1 = prob of finding food in patch 1 = hi or lo
p2 = prob of finding food in patch 2 = hi or lo
(p1,p2) combinations
30% chance of (hi,lo)
25% chance of (hi,hi)
25% chance of (lo,lo)
20% chance of (lo,hi)
The most straight forward way would just be adding it up
total fitness Fd = 0.3(F1) + 0.25(F2) + 0.25(F3) + 0.2(F4)
My code for fitness is already very long with only one combination of finding food probabilities. Is there a way I could do a for loop with these combinations and add in that probability or do I have to go the long way around? for loop, probabilities MATLAB Answers — New Questions