Stock variabel with 2 outflows
Posted: Fri Nov 14, 2008 12:42 pm
Hi,
a beginner's problem.
I have a stock variable which has 2 outflows. Now I want to make sure that the stock never reaches something below zero.
stock ... population
outflow 1 ... moveing
outflow 2 ... deaths
Both outflows are influced by some other varibales.
What I have done is this: for both outflows I used an IF_THEN_ELSE like
IF Stock-myCurrentOutFlow>0 THE myCurrentOutFlow ELSE Stock
Are there any other (better) solutions? What really troubles me is that there are 2 outflows.
Maybe both checks are done and after that the execution of both statements takes place. The checks would be ok but the stock could drop below zero!!!
BTW: is there something like user-defined-function? I do not want external DLLs, just a combination of some built-in functions.
Best regards,
jmu
a beginner's problem.
I have a stock variable which has 2 outflows. Now I want to make sure that the stock never reaches something below zero.
stock ... population
outflow 1 ... moveing
outflow 2 ... deaths
Both outflows are influced by some other varibales.
What I have done is this: for both outflows I used an IF_THEN_ELSE like
IF Stock-myCurrentOutFlow>0 THE myCurrentOutFlow ELSE Stock
Are there any other (better) solutions? What really troubles me is that there are 2 outflows.
Maybe both checks are done and after that the execution of both statements takes place. The checks would be ok but the stock could drop below zero!!!
BTW: is there something like user-defined-function? I do not want external DLLs, just a combination of some built-in functions.
Best regards,
jmu