I am doing a system dynamics stock and flow model in AnyLogic (a very basic one but it’s my first time) and I keep getting errors that I can’t seem to fix. I get a “top-level agent is not specified” and a syntax error which I can’t fix because I can’t modify the Main.java code. Is there anyone here who could find it in their hearts to help me? It’s a project for school and I’m feeling overwhelmed. If you’re willing to answer a few questions and help me figure out what’s wrong, send me an email to [email protected] and Ii’ll give you more info.
Thanks in advance!
I’m trying to model the effects of Nutritional interventions on frailty, more particularly slowness, in elderly. I have two stocks, one of them being Age and the other is Slowness. I have two flows going into them, NutritionEffectSlowness and AgeEffectSlowness. I have the fraction effects of Nutrition on Slowness and the effects of age on slowness (so two parameters called NutrEffectSlow and AgeEffectFraction). I also know the initial slowness (5.8seconds) and I have the Threshold of how slow you can be to considered frail (7.5 seconds). Initial Age parameter is 65. The equations for my flows are SlownessNutrEffectSlow and AgeAgeEffectFraction.
Also, the effects of the interventions only work for the first year but the effects of age should keep going yearly. This is the custom equation I made for the Slowness stock…
if (time <= 1) {
// For year 1: Include both nutrition and age effects
Slowness = Slowness + NutritionEffectSlowness + AgeEffectSlowness;
} else {
// For subsequent years: Include only age effect
Slowness = Slowness + AgeEffectSlowness;
}
// Check if slowness exceeds the slowness threshold
if (Slowness >= SlownessThreshold) {
stopSimulation(); // Stop the simulation if slowness exceeds the frailty threshold
}
Could someone tell me how I should set up the links or set the whole thing up in a more simple way?
Ester Gunnarsdottir is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.