79323549

Date: 2025-01-02 11:26:39
Score: 0.5
Natty:
Report link

Welcome to StackOverflow and congratulations on a very detailed first question.

If your agents are initialized correctly, there is just one point you are missing. On the CarSource block, when you go into Initial Speed you will see a lightbulb on the left side of the text control. This lightbulb shows you any special variables available in that context.

In this case, you have self (which points on the block itself) and car, which points to the instance of car being created. If you want to use this information, you could set the initial speed for example to car.velocidadeEmergencia() - which will call the function on each instance.

Again, it is very important in this case that the agents (cars) are initialized correctly. In this case, it is correct since the modoEmergencia variable has an initial value.

Reasons:
  • Blacklisted phrase (1): StackOverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Enrico