Original model was created in AnyLogic7. To open this model, I resave it in 8.8.6. Although this model(8.8.6) can be successfully opened, it fails to run. It seems that there's an incompatibility between the new and old versions of Java. I would like to inquire about how to modify the JavaScript.
for (Pedestrian thisPed : get_Main().pedestrian) {
// for each pedestrian in model
double pedX = thisPed.getX() - getX();
double pedY = thisPed.getY() - getY();
if (fieldOfView.contains(pedX, pedY)) {
pedInDanger = true;
break;
}
}
I modify get_Main().pedestrian to "main.pedstrain". The code does not compile and give an error message "main cannot be resolved to a variable". I cannot figure out why the transition cannot recognise main. Thanks in advance!