fillEnv(params, umg);
}
if (this.clearAgent) {
this.clearAgent = false;
AllroundVideoPlugin vid = (AllroundVideoPlugin) umg.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
try {
umg.removeAgent(vid.getMarkedAgentId());
} catch (Exception e) {
}
}
if (!pause && w.getLastTick() % 5 == 0) {
PhysicsAgent2D<PhysEnvSimple> agent;
if (new Random().nextBoolean()) {
agent = new PhysAgentRectangleSimple((int) w.getLastTick(), umg, 10, params);
} else {
agent = new PhysAgentCircleSimple((int) w.getLastTick(), umg, 10, params);
}
umg.addAgent(agent, new Vector2D(15, 113), 90);
agent.addForce(new Vector2f(-100000, 0));
}
if (insertAgent && w.getLastTick() % 1 == 0) {
PhysicsAgent2D<PhysEnvSimple> agent;
if (new Random().nextBoolean()) {
agent = new PhysAgentRectangleSimple((int) w.getLastTick(), umg, 10, params);
} else {
agent = new PhysAgentCircleSimple((int) w.getLastTick(), umg, 10, params);
}
umg.addAgent(agent, new Vector2D(-70, 70), 0);
agent.addForce(new Vector2f(0, 1000));
}
if (insertAgent2 && w.getLastTick() % 1 == 0) {
PhysicsAgent2D<PhysEnvSimple> agent;
if (new Random().nextBoolean()) {
agent = new PhysAgentRectangleSimple((int) w.getLastTick(),
umg, 10, params);
} else {
agent = new PhysAgentCircleSimple((int) w.getLastTick(),
umg, 10, params);
}
umg.addAgent(agent, new Vector2D(-100, -30), 0);
agent.addForce(new Vector2f(0, 1000));
}
if (insertAgent3 && w.getLastTick() % 1 == 0) {
PhysicsAgent2D<PhysEnvSimple> agent;
if (new Random().nextBoolean()) {
agent = new PhysAgentRectangleSimple((int) w.getLastTick(),
umg, 10, params);
} else {
agent = new PhysAgentCircleSimple((int) w.getLastTick(),
umg, 10, params);
}
try {
AllroundVideoPlugin vid = (AllroundVideoPlugin) umg.getSimTime().getPluginObject(new AllroundVideoPlugin().id());
umg.addAgent(agent, umg.getAgentPosition(vid.getMarkedAgentId()), 0);
agent.addForce(new Vector2f(0, 1000));
} catch (Exception e) {
}
}