Browse Source

VI51 - TP3

master
Skia 3 years ago
parent
commit
d2a256b17c
100 changed files with 11105 additions and 0 deletions
  1. 304
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/SimulatorAgent.java
  2. 231
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/agent/AbstractAnimat.java
  3. 118
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/agent/PhysicEnvironment.java
  4. 360
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/agent/StandardPhysicEnvironment.java
  5. 403
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/EnvironmentAgent.java
  6. 65
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/InfluenceEvent.java
  7. 87
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/PerceptionEvent.java
  8. 35
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/SimulationAgentReady.java
  9. 35
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/StartSimulation.java
  10. 35
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/StopSimulation.java
  11. 421
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/labwork2/agent/Rabbit.java
  12. 34
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/labwork2/behavior/kinematic/KinematicAlignBehaviour.java
  13. 23
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/labwork2/behavior/kinematic/KinematicSeekBehaviour.java
  14. 33
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/labwork2/behavior/steering/SteeringAlignBehaviour.java
  15. 23
    0
      VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/labwork2/behavior/steering/SteeringSeekBehaviour.java
  16. 2
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/environment/AbstractMobileObject.properties
  17. 2
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/environment/AbstractMobileObject_fr.properties
  18. 1
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/environment/AbstractSituatedObject.properties
  19. 1
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/environment/AbstractSituatedObject_fr.properties
  20. 1
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/environment/AgentBody.properties
  21. 1
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/environment/AgentBody_fr.properties
  22. 3
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/gui/AbstractFrameworkGUI.properties
  23. 3
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/gui/AbstractFrameworkGUI_fr.properties
  24. 3
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/gui/BehaviorTypeSelector.properties
  25. 3
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/gui/BehaviorTypeSelector_fr.properties
  26. BIN
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/gui/kinematic.png
  27. BIN
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/framework/gui/steering.png
  28. 4
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/MainProgram.properties
  29. 4
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/MainProgram_fr.properties
  30. 1
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/environment/WorldModel.properties
  31. 1
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/environment/WorldModel_fr.properties
  32. 2
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/gui/GUI.properties
  33. 2
    0
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/gui/GUI_fr.properties
  34. BIN
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/gui/carrot.png
  35. BIN
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/gui/icon.png
  36. BIN
      VI51-TP3/src/main/resources/fr/utbm/info/vi51/labwork2/gui/rabbit.png
  37. 121
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/FrameworkLauncher.java
  38. 152
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/agent/BehaviourOutput.java
  39. 50
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/agent/agent.sarl
  40. 22
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/agent/capacity.sarl
  41. 69
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/agent/skill.sarl
  42. 343
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/AbstractEnvironment.java
  43. 103
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/AbstractFrustum.java
  44. 349
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/AbstractMobileObject.java
  45. 216
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/AbstractSituatedObject.java
  46. 236
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/AgentBody.java
  47. 84
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/Body.java
  48. 37
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/DynamicType.java
  49. 96
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/Environment.java
  50. 58
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/EnvironmentEvent.java
  51. 37
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/EnvironmentListener.java
  52. 60
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/Frustum.java
  53. 70
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/Influence.java
  54. 39
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/KillInfluence.java
  55. 85
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/MobileObject.java
  56. 229
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/MotionInfluence.java
  57. 250
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/Percept.java
  58. 39
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/ShapedObject.java
  59. 78
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/SituatedObject.java
  60. 52
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/WorldModelState.java
  61. 91
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/environment.sarl
  62. 48
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/environment/events.sarl
  63. 516
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/gui/AbstractFrameworkGUI.java
  64. 116
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/gui/BehaviorTypeSelector.java
  65. 41
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/gui/FrameworkGUI.java
  66. 57
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/gui/WorldModelStateProvider.java
  67. 150
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/Circle2f.java
  68. 286
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/MathUtil.java
  69. 193
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/MotionHull2f.java
  70. 386
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/Point2f.java
  71. 192
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/Rectangle2f.java
  72. 78
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/Shape2f.java
  73. 625
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/Tuple2f.java
  74. 634
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/math/Vector2f.java
  75. 64
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/simulator.sarl
  76. 96
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/time/AbstractTime.java
  77. 38
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/time/AbstractTimeManager.java
  78. 73
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/time/StepTimeManager.java
  79. 67
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/time/Time.java
  80. 52
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/time/TimeManager.java
  81. 85
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/time/TimePercept.java
  82. 60
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/util/AddressUUIDScope.java
  83. 121
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/util/CollectionUtil.java
  84. 328
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/util/LocaleMessageFormat.java
  85. 507
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/util/LocalizedString.java
  86. 99
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/util/ResourceWrapper.java
  87. 377
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/util/Resources.java
  88. 47
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/framework/util/SpawnMapping.java
  89. 81
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/MainProgram.java
  90. 82
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/agent/rabbit.sarl
  91. 41
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/behavior/AlignBehaviour.java
  92. 43
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/behavior/FaceBehaviour.java
  93. 41
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/behavior/SeekBehaviour.java
  94. 45
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/behavior/WanderBehaviour.java
  95. 34
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/behavior/kinematic/KinematicBehaviors.sarl
  96. 17
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/behavior/kinematic/KinematicWanderBehaviour.java
  97. 50
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/behavior/steering/SteeringBehaviors.sarl
  98. 71
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/environment/AnimatAction.java
  99. 57
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/environment/MouseTarget.java
  100. 0
    0
      VI51-TP3/src/main/sarl/fr/utbm/info/vi51/labwork2/environment/WorldModel.java

+ 304
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/SimulatorAgent.java View File

@@ -0,0 +1,304 @@
package fr.utbm.info.vi51.framework;

import fr.utbm.info.vi51.framework.environment.AgentBody;
import fr.utbm.info.vi51.framework.environment.DynamicType;
import fr.utbm.info.vi51.framework.environment.Environment;
import fr.utbm.info.vi51.framework.environment.EnvironmentAgent;
import fr.utbm.info.vi51.framework.environment.SimulationAgentReady;
import fr.utbm.info.vi51.framework.environment.StartSimulation;
import fr.utbm.info.vi51.framework.util.SpawnMapping;
import io.sarl.core.AgentKilled;
import io.sarl.core.AgentSpawned;
import io.sarl.core.DefaultContextInteractions;
import io.sarl.core.Destroy;
import io.sarl.core.Initialize;
import io.sarl.core.Lifecycle;
import io.sarl.lang.annotation.EarlyExit;
import io.sarl.lang.annotation.FiredEvent;
import io.sarl.lang.annotation.ImportedCapacityFeature;
import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Agent;
import io.sarl.lang.core.AgentContext;
import io.sarl.lang.core.BuiltinCapacitiesProvider;
import io.sarl.lang.core.Event;
import io.sarl.lang.core.EventSpace;
import io.sarl.lang.core.Percept;
import io.sarl.lang.core.Scope;
import io.sarl.lang.core.Space;
import io.sarl.lang.core.SpaceID;
import io.sarl.util.OpenEventSpace;
import io.sarl.util.OpenEventSpaceSpecification;
import java.util.List;
import java.util.UUID;
import javax.annotation.Generated;
import javax.inject.Inject;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Conversions;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.Pure;

/**
* This agent is managing the simulator.
*
* @author Stéphane GALLAND <stephane.galland@utbm.fr>
*/
@SarlSpecification("0.3")
@SuppressWarnings("all")
public class SimulatorAgent extends Agent {
protected int waitingAgents = 0;
@Percept
public void _handle_Initialize_0(final Initialize occurrence) {
Object _get = occurrence.parameters[0];
Environment environment = ((Environment) _get);
Object _get_1 = occurrence.parameters[1];
UUID spaceId = ((UUID) _get_1);
Object _get_2 = occurrence.parameters[2];
SpawnMapping spawnMapping = ((SpawnMapping) _get_2);
Object _get_3 = occurrence.parameters[3];
DynamicType behaviorType = ((DynamicType) _get_3);
AgentContext _defaultContext = this.getDefaultContext();
OpenEventSpace space = _defaultContext.<OpenEventSpace>getOrCreateSpaceWithID(spaceId, OpenEventSpaceSpecification.class);
Iterable<? extends AgentBody> _agentBodies = environment.getAgentBodies();
int _size = IterableExtensions.size(_agentBodies);
int _plus = (_size + 1);
this.waitingAgents = _plus;
UUID environmentId = this.spawn(EnvironmentAgent.class, environment, spaceId);
List<Object> agentParameters = CollectionLiterals.<Object>newArrayList(spaceId, environmentId, behaviorType);
for (int i = 4; (i < ((List<Object>)Conversions.doWrapArray(occurrence.parameters)).size()); i++) {
Object _get_4 = occurrence.parameters[i];
agentParameters.add(_get_4);
}
Iterable<? extends AgentBody> _agentBodies_1 = environment.getAgentBodies();
for (final AgentBody body : _agentBodies_1) {
{
Class<? extends Agent> agentType = spawnMapping.getAgentTypeForBody(body);
UUID _iD = body.getID();
AgentContext _defaultContext_1 = this.getDefaultContext();
Object[] _array = agentParameters.toArray();
this.spawnInContextWithID(agentType, _iD, _defaultContext_1, _array);
}
}
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@Pure
private boolean _eventhandler_guard_SimulationAgentReady_1(final SimulationAgentReady it, final SimulationAgentReady occurrence) {
boolean _isFromMe = this.isFromMe(occurrence);
boolean _not = (!_isFromMe);
return _not;
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
private void _eventhandler_body_SimulationAgentReady_1(final SimulationAgentReady occurrence) {
synchronized (this) {
this.waitingAgents--;
if ((this.waitingAgents <= 0)) {
StartSimulation _startSimulation = new StartSimulation();
this.emit(_startSimulation);
this.killMe();
}
}
}
@Percept
public void _handle_SimulationAgentReady_1(final SimulationAgentReady occurrence) {
if (_eventhandler_guard_SimulationAgentReady_1(occurrence, occurrence)) {
_eventhandler_body_SimulationAgentReady_1(occurrence);
}
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0, final Scope<Address> arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultAddress()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultAddress()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected Address getDefaultAddress() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultAddress();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultContext()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultContext()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected AgentContext getDefaultContext() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultContext();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultSpace()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultSpace()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected EventSpace getDefaultSpace() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultSpace();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final AgentContext arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final Space arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final SpaceID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isInDefaultSpace(final Event arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isInDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void receive(final UUID arg0, final Event arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).receive(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])}.
*
* @see io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected UUID spawn(final Class<? extends Agent> arg0, final Object... arg1) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).spawn(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#killMe()}.
*
* @see io.sarl.core.Lifecycle#killMe()
*/
@EarlyExit
@FiredEvent({ AgentKilled.class, Destroy.class })
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected void killMe() {
getSkill(io.sarl.core.Lifecycle.class).killMe();
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#spawnInContext(java.lang.Class<? extends io.sarl.lang.core.Agent>,io.sarl.lang.core.AgentContext,java.lang.Object[])}.
*
* @see io.sarl.core.Lifecycle#spawnInContext(java.lang.Class<? extends io.sarl.lang.core.Agent>,io.sarl.lang.core.AgentContext,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected UUID spawnInContext(final Class<? extends Agent> arg0, final AgentContext arg1, final Object... arg2) {
return getSkill(io.sarl.core.Lifecycle.class).spawnInContext(arg0, arg1, arg2);
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#spawnInContextWithID(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.util.UUID,io.sarl.lang.core.AgentContext,java.lang.Object[])}.
*
* @see io.sarl.core.Lifecycle#spawnInContextWithID(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.util.UUID,io.sarl.lang.core.AgentContext,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected UUID spawnInContextWithID(final Class<? extends Agent> arg0, final UUID arg1, final AgentContext arg2, final Object... arg3) {
return getSkill(io.sarl.core.Lifecycle.class).spawnInContextWithID(arg0, arg1, arg2, arg3);
}
/**
* Construct an agent.
* @param builtinCapacityProvider - provider of the built-in capacities.
* @param parentID - identifier of the parent. It is the identifier of the parent agent and the enclosing contect, at the same time.
* @param agentID - identifier of the agent. If <code>null</code> the agent identifier will be computed randomly.
*/
@Inject
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public SimulatorAgent(final BuiltinCapacitiesProvider builtinCapacityProvider, final UUID parentID, final UUID agentID) {
super(builtinCapacityProvider, parentID, agentID);
}
}

+ 231
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/agent/AbstractAnimat.java View File

@@ -0,0 +1,231 @@
package fr.utbm.info.vi51.framework.agent;

import com.google.common.base.Objects;
import fr.utbm.info.vi51.framework.agent.BehaviourOutput;
import fr.utbm.info.vi51.framework.agent.PhysicEnvironment;
import fr.utbm.info.vi51.framework.agent.StandardPhysicEnvironment;
import fr.utbm.info.vi51.framework.environment.DynamicType;
import fr.utbm.info.vi51.framework.environment.StopSimulation;
import fr.utbm.info.vi51.framework.math.Vector2f;
import io.sarl.core.AgentKilled;
import io.sarl.core.AgentSpawned;
import io.sarl.core.Destroy;
import io.sarl.core.Initialize;
import io.sarl.core.Lifecycle;
import io.sarl.lang.annotation.EarlyExit;
import io.sarl.lang.annotation.FiredEvent;
import io.sarl.lang.annotation.ImportedCapacityFeature;
import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Agent;
import io.sarl.lang.core.AgentContext;
import io.sarl.lang.core.BuiltinCapacitiesProvider;
import io.sarl.lang.core.Percept;
import java.util.UUID;
import javax.annotation.Generated;
import javax.inject.Inject;
import org.eclipse.xtext.xbase.lib.Pure;

@SarlSpecification("0.3")
@SuppressWarnings("all")
public class AbstractAnimat extends Agent {
protected DynamicType behaviorType;
@Percept
public void _handle_Initialize_0(final Initialize occurrence) {
Object _get = occurrence.parameters[0];
Object _get_1 = occurrence.parameters[1];
StandardPhysicEnvironment physicSkill = new StandardPhysicEnvironment(
((UUID) _get),
((UUID) _get_1));
Object _get_2 = occurrence.parameters[2];
this.behaviorType = ((DynamicType) _get_2);
this.<StandardPhysicEnvironment>setSkill(PhysicEnvironment.class, physicSkill);
}
@Pure
protected float getMaxLinear(final fr.utbm.info.vi51.framework.environment.Percept p) {
float _xifexpression = (float) 0;
boolean _equals = Objects.equal(this.behaviorType, DynamicType.STEERING);
if (_equals) {
_xifexpression = p.getMaxLinearAcceleration();
} else {
_xifexpression = p.getMaxLinearSpeed();
}
return _xifexpression;
}
@Pure
protected float getMaxAngular(final fr.utbm.info.vi51.framework.environment.Percept p) {
float _xifexpression = (float) 0;
boolean _equals = Objects.equal(this.behaviorType, DynamicType.STEERING);
if (_equals) {
_xifexpression = p.getMaxAngularAcceleration();
} else {
_xifexpression = p.getMaxAngularSpeed();
}
return _xifexpression;
}
protected void emitInfluence(final BehaviourOutput output) {
if ((output != null)) {
DynamicType _type = output.getType();
boolean _tripleEquals = (_type == DynamicType.STEERING);
if (_tripleEquals) {
Vector2f _linear = output.getLinear();
float _angular = output.getAngular();
this.influenceSteering(_linear, _angular);
} else {
Vector2f _linear_1 = output.getLinear();
float _angular_1 = output.getAngular();
this.influenceKinematic(_linear_1, _angular_1);
}
}
}
protected void doNothing() {
Vector2f _vector2f = new Vector2f();
this.influenceSteering(_vector2f, 0f);
}
@Percept
public void _handle_StopSimulation_1(final StopSimulation occurrence) {
this.killMe();
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic()}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceKinematic() {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceKinematic();
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic(float)}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic(float)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceKinematic(final float angularInfluence) {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceKinematic(angularInfluence);
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic(fr.utbm.info.vi51.framework.math.Vector2f)}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic(fr.utbm.info.vi51.framework.math.Vector2f)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceKinematic(final Vector2f linearInfluence) {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceKinematic(linearInfluence);
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic(fr.utbm.info.vi51.framework.math.Vector2f,float)}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceKinematic(fr.utbm.info.vi51.framework.math.Vector2f,float)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceKinematic(final Vector2f linearInfluence, final float angularInfluence) {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceKinematic(linearInfluence, angularInfluence);
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering()}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceSteering() {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceSteering();
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering(float)}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering(float)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceSteering(final float angularInfluence) {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceSteering(angularInfluence);
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering(fr.utbm.info.vi51.framework.math.Vector2f)}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering(fr.utbm.info.vi51.framework.math.Vector2f)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceSteering(final Vector2f linearInfluence) {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceSteering(linearInfluence);
}
/**
* See the capacity {@link fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering(fr.utbm.info.vi51.framework.math.Vector2f,float)}.
*
* @see fr.utbm.info.vi51.framework.agent.PhysicEnvironment#influenceSteering(fr.utbm.info.vi51.framework.math.Vector2f,float)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(PhysicEnvironment.class)
protected void influenceSteering(final Vector2f linearInfluence, final float angularInfluence) {
getSkill(fr.utbm.info.vi51.framework.agent.PhysicEnvironment.class).influenceSteering(linearInfluence, angularInfluence);
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#killMe()}.
*
* @see io.sarl.core.Lifecycle#killMe()
*/
@EarlyExit
@FiredEvent({ AgentKilled.class, Destroy.class })
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected void killMe() {
getSkill(io.sarl.core.Lifecycle.class).killMe();
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#spawnInContext(java.lang.Class<? extends io.sarl.lang.core.Agent>,io.sarl.lang.core.AgentContext,java.lang.Object[])}.
*
* @see io.sarl.core.Lifecycle#spawnInContext(java.lang.Class<? extends io.sarl.lang.core.Agent>,io.sarl.lang.core.AgentContext,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected UUID spawnInContext(final Class<? extends Agent> arg0, final AgentContext arg1, final Object... arg2) {
return getSkill(io.sarl.core.Lifecycle.class).spawnInContext(arg0, arg1, arg2);
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#spawnInContextWithID(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.util.UUID,io.sarl.lang.core.AgentContext,java.lang.Object[])}.
*
* @see io.sarl.core.Lifecycle#spawnInContextWithID(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.util.UUID,io.sarl.lang.core.AgentContext,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected UUID spawnInContextWithID(final Class<? extends Agent> arg0, final UUID arg1, final AgentContext arg2, final Object... arg3) {
return getSkill(io.sarl.core.Lifecycle.class).spawnInContextWithID(arg0, arg1, arg2, arg3);
}
/**
* Construct an agent.
* @param builtinCapacityProvider - provider of the built-in capacities.
* @param parentID - identifier of the parent. It is the identifier of the parent agent and the enclosing contect, at the same time.
* @param agentID - identifier of the agent. If <code>null</code> the agent identifier will be computed randomly.
*/
@Inject
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public AbstractAnimat(final BuiltinCapacitiesProvider builtinCapacityProvider, final UUID parentID, final UUID agentID) {
super(builtinCapacityProvider, parentID, agentID);
}
}

+ 118
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/agent/PhysicEnvironment.java View File

@@ -0,0 +1,118 @@
package fr.utbm.info.vi51.framework.agent;

import fr.utbm.info.vi51.framework.math.Vector2f;
import io.sarl.lang.annotation.DefaultValue;
import io.sarl.lang.annotation.DefaultValueSource;
import io.sarl.lang.annotation.DefaultValueUse;
import io.sarl.lang.annotation.SarlSourceCode;
import io.sarl.lang.core.Capacity;
import javax.annotation.Generated;

@SuppressWarnings("all")
public interface PhysicEnvironment extends Capacity {
/**
* Invoked to send the influence to the environment.
*
* @param linearInfluence is the linear influence to apply on the object.
* @param angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueSource
public abstract void influenceKinematic(@DefaultValue("fr.utbm.info.vi51.framework.agent.PhysicEnvironment#INFLUENCEKINEMATIC_0") final Vector2f linearInfluence, @DefaultValue("fr.utbm.info.vi51.framework.agent.PhysicEnvironment#INFLUENCEKINEMATIC_1") final float angularInfluence);
/**
* Default value for the parameter linearInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" null")
public final static Vector2f ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_0 = null;
/**
* Default value for the parameter angularInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" 0f")
public final static float ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_1 = 0f;
/**
* Invoked to send the influence to the environment.
*
* @param linearInfluence is the linear influence to apply on the object.
* @param angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueSource
public abstract void influenceSteering(@DefaultValue("fr.utbm.info.vi51.framework.agent.PhysicEnvironment#INFLUENCESTEERING_0") final Vector2f linearInfluence, @DefaultValue("fr.utbm.info.vi51.framework.agent.PhysicEnvironment#INFLUENCESTEERING_1") final float angularInfluence);
/**
* Default value for the parameter linearInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" null")
public final static Vector2f ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_0 = null;
/**
* Default value for the parameter angularInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" 0f")
public final static float ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_1 = 0f;
/**
* Invoked to send the influence to the environment.
*
* @optionalparam linearInfluence is the linear influence to apply on the object.
* @optionalparam angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public abstract void influenceKinematic();
/**
* Invoked to send the influence to the environment.
*
* @optionalparam linearInfluence is the linear influence to apply on the object.
* @param angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public abstract void influenceKinematic(final float angularInfluence);
/**
* Invoked to send the influence to the environment.
*
* @param linearInfluence is the linear influence to apply on the object.
* @optionalparam angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public abstract void influenceKinematic(final Vector2f linearInfluence);
/**
* Invoked to send the influence to the environment.
*
* @optionalparam linearInfluence is the linear influence to apply on the object.
* @optionalparam angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public abstract void influenceSteering();
/**
* Invoked to send the influence to the environment.
*
* @optionalparam linearInfluence is the linear influence to apply on the object.
* @param angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public abstract void influenceSteering(final float angularInfluence);
/**
* Invoked to send the influence to the environment.
*
* @param linearInfluence is the linear influence to apply on the object.
* @optionalparam angularInfluence is the angular influence to apply on the object.
*/
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public abstract void influenceSteering(final Vector2f linearInfluence);
}

+ 360
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/agent/StandardPhysicEnvironment.java View File

@@ -0,0 +1,360 @@
package fr.utbm.info.vi51.framework.agent;

import fr.utbm.info.vi51.framework.agent.PhysicEnvironment;
import fr.utbm.info.vi51.framework.environment.DynamicType;
import fr.utbm.info.vi51.framework.environment.InfluenceEvent;
import fr.utbm.info.vi51.framework.environment.KillInfluence;
import fr.utbm.info.vi51.framework.environment.MotionInfluence;
import fr.utbm.info.vi51.framework.math.Vector2f;
import fr.utbm.info.vi51.framework.util.AddressUUIDScope;
import io.sarl.core.AgentSpawned;
import io.sarl.core.Behaviors;
import io.sarl.core.DefaultContextInteractions;
import io.sarl.lang.annotation.DefaultValue;
import io.sarl.lang.annotation.DefaultValueSource;
import io.sarl.lang.annotation.DefaultValueUse;
import io.sarl.lang.annotation.FiredEvent;
import io.sarl.lang.annotation.ImportedCapacityFeature;
import io.sarl.lang.annotation.SarlSourceCode;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Agent;
import io.sarl.lang.core.AgentContext;
import io.sarl.lang.core.Behavior;
import io.sarl.lang.core.Event;
import io.sarl.lang.core.EventListener;
import io.sarl.lang.core.EventSpace;
import io.sarl.lang.core.Scope;
import io.sarl.lang.core.Skill;
import io.sarl.lang.core.Space;
import io.sarl.lang.core.SpaceID;
import io.sarl.util.OpenEventSpace;
import java.util.UUID;
import javax.annotation.Generated;

@SuppressWarnings("all")
public class StandardPhysicEnvironment extends Skill implements PhysicEnvironment {
protected final UUID spaceID;
protected final UUID environmentID;
protected OpenEventSpace physicSpace;
protected Address myAdr;
public StandardPhysicEnvironment(final UUID spaceID, final UUID environmentID) {
this.environmentID = environmentID;
this.spaceID = spaceID;
}
public void install() {
do {
{
AgentContext _defaultContext = this.getDefaultContext();
OpenEventSpace _space = _defaultContext.<OpenEventSpace>getSpace(this.spaceID);
this.physicSpace = _space;
Thread.yield();
}
} while((this.physicSpace == null));
EventListener _asEventListener = this.asEventListener();
this.physicSpace.register(_asEventListener);
Agent _owner = this.getOwner();
UUID _iD = _owner.getID();
Address _address = this.physicSpace.getAddress(_iD);
this.myAdr = _address;
}
public void uninstall() {
KillInfluence _killInfluence = new KillInfluence();
InfluenceEvent event = new InfluenceEvent(_killInfluence);
event.setSource(this.myAdr);
AddressUUIDScope _addressUUIDScope = new AddressUUIDScope(this.environmentID);
this.physicSpace.emit(event, _addressUUIDScope);
this.physicSpace = null;
}
@DefaultValueSource
public void influenceKinematic(@DefaultValue("fr.utbm.info.vi51.framework.agent.StandardPhysicEnvironment#INFLUENCEKINEMATIC_0") final Vector2f linearInfluence, @DefaultValue("fr.utbm.info.vi51.framework.agent.StandardPhysicEnvironment#INFLUENCEKINEMATIC_1") final float angularInfluence) {
MotionInfluence mi = null;
boolean _tripleEquals = linearInfluence.operator_tripleEquals(null);
if (_tripleEquals) {
MotionInfluence _motionInfluence = new MotionInfluence(DynamicType.KINEMATIC, angularInfluence);
mi = _motionInfluence;
} else {
MotionInfluence _motionInfluence_1 = new MotionInfluence(DynamicType.KINEMATIC, linearInfluence, angularInfluence);
mi = _motionInfluence_1;
}
InfluenceEvent event = new InfluenceEvent(mi);
event.setSource(this.myAdr);
AddressUUIDScope _addressUUIDScope = new AddressUUIDScope(this.environmentID);
this.physicSpace.emit(event, _addressUUIDScope);
}
/**
* Default value for the parameter linearInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" null")
private final static Vector2f ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_0 = null;
/**
* Default value for the parameter angularInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" 0f")
private final static float ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_1 = 0f;
@DefaultValueSource
public void influenceSteering(@DefaultValue("fr.utbm.info.vi51.framework.agent.StandardPhysicEnvironment#INFLUENCESTEERING_0") final Vector2f linearInfluence, @DefaultValue("fr.utbm.info.vi51.framework.agent.StandardPhysicEnvironment#INFLUENCESTEERING_1") final float angularInfluence) {
MotionInfluence mi = null;
boolean _tripleEquals = linearInfluence.operator_tripleEquals(null);
if (_tripleEquals) {
MotionInfluence _motionInfluence = new MotionInfluence(DynamicType.STEERING, angularInfluence);
mi = _motionInfluence;
} else {
MotionInfluence _motionInfluence_1 = new MotionInfluence(DynamicType.STEERING, linearInfluence, angularInfluence);
mi = _motionInfluence_1;
}
InfluenceEvent event = new InfluenceEvent(mi);
event.setSource(this.myAdr);
AddressUUIDScope _addressUUIDScope = new AddressUUIDScope(this.environmentID);
this.physicSpace.emit(event, _addressUUIDScope);
}
/**
* Default value for the parameter linearInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" null")
private final static Vector2f ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_0 = null;
/**
* Default value for the parameter angularInfluence
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@SarlSourceCode(" 0f")
private final static float ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_1 = 0f;
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0, final Scope<Address> arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultAddress()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultAddress()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected Address getDefaultAddress() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultAddress();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultContext()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultContext()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected AgentContext getDefaultContext() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultContext();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultSpace()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultSpace()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected EventSpace getDefaultSpace() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultSpace();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final AgentContext arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final Space arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final SpaceID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isInDefaultSpace(final Event arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isInDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void receive(final UUID arg0, final Event arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).receive(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])}.
*
* @see io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected UUID spawn(final Class<? extends Agent> arg0, final Object... arg1) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).spawn(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.Behaviors#asEventListener()}.
*
* @see io.sarl.core.Behaviors#asEventListener()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected EventListener asEventListener() {
return getSkill(io.sarl.core.Behaviors.class).asEventListener();
}
/**
* See the capacity {@link io.sarl.core.Behaviors#registerBehavior(io.sarl.lang.core.Behavior)}.
*
* @see io.sarl.core.Behaviors#registerBehavior(io.sarl.lang.core.Behavior)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected Behavior registerBehavior(final Behavior arg0) {
return getSkill(io.sarl.core.Behaviors.class).registerBehavior(arg0);
}
/**
* See the capacity {@link io.sarl.core.Behaviors#unregisterBehavior(io.sarl.lang.core.Behavior)}.
*
* @see io.sarl.core.Behaviors#unregisterBehavior(io.sarl.lang.core.Behavior)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected Behavior unregisterBehavior(final Behavior arg0) {
return getSkill(io.sarl.core.Behaviors.class).unregisterBehavior(arg0);
}
/**
* See the capacity {@link io.sarl.core.Behaviors#wake(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.Behaviors#wake(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected void wake(final Event arg0) {
getSkill(io.sarl.core.Behaviors.class).wake(arg0);
}
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public final void influenceKinematic() {
influenceKinematic(___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_0, ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_1);
}
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public final void influenceKinematic(final float angularInfluence) {
influenceKinematic(___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_0, angularInfluence);
}
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public final void influenceKinematic(final Vector2f linearInfluence) {
influenceKinematic(linearInfluence, ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCEKINEMATIC_1);
}
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public final void influenceSteering() {
influenceSteering(___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_0, ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_1);
}
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public final void influenceSteering(final float angularInfluence) {
influenceSteering(___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_0, angularInfluence);
}
@DefaultValueUse("fr.utbm.info.vi51.framework.math.Vector2f,float")
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public final void influenceSteering(final Vector2f linearInfluence) {
influenceSteering(linearInfluence, ___FORMAL_PARAMETER_DEFAULT_VALUE_INFLUENCESTEERING_1);
}
}

+ 403
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/EnvironmentAgent.java View File

@@ -0,0 +1,403 @@
package fr.utbm.info.vi51.framework.environment;

import fr.utbm.info.vi51.framework.environment.AgentBody;
import fr.utbm.info.vi51.framework.environment.Environment;
import fr.utbm.info.vi51.framework.environment.InfluenceEvent;
import fr.utbm.info.vi51.framework.environment.PerceptionEvent;
import fr.utbm.info.vi51.framework.environment.SimulationAgentReady;
import fr.utbm.info.vi51.framework.environment.StartSimulation;
import fr.utbm.info.vi51.framework.environment.StopSimulation;
import fr.utbm.info.vi51.framework.time.TimeManager;
import fr.utbm.info.vi51.framework.time.TimePercept;
import fr.utbm.info.vi51.framework.util.AddressUUIDScope;
import io.sarl.core.AgentKilled;
import io.sarl.core.AgentSpawned;
import io.sarl.core.Behaviors;
import io.sarl.core.DefaultContextInteractions;
import io.sarl.core.Destroy;
import io.sarl.core.Initialize;
import io.sarl.core.Lifecycle;
import io.sarl.lang.annotation.EarlyExit;
import io.sarl.lang.annotation.FiredEvent;
import io.sarl.lang.annotation.ImportedCapacityFeature;
import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Agent;
import io.sarl.lang.core.AgentContext;
import io.sarl.lang.core.Behavior;
import io.sarl.lang.core.BuiltinCapacitiesProvider;
import io.sarl.lang.core.Event;
import io.sarl.lang.core.EventListener;
import io.sarl.lang.core.EventSpace;
import io.sarl.lang.core.Percept;
import io.sarl.lang.core.Scope;
import io.sarl.lang.core.Space;
import io.sarl.lang.core.SpaceID;
import io.sarl.util.OpenEventSpace;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Generated;
import javax.inject.Inject;
import org.eclipse.xtext.xbase.lib.Exceptions;
import org.eclipse.xtext.xbase.lib.Pure;

/**
* This agent is managing the physic space.
*
* @author St&eacute;phane GALLAND &lt;stephane.galland@utbm.fr&gt;
*/
@SarlSpecification("0.3")
@SuppressWarnings("all")
public class EnvironmentAgent extends Agent {
protected Environment environment;
protected OpenEventSpace space;
protected Address myAdr;
protected int influences = 0;
protected final AtomicBoolean freeze = new AtomicBoolean(false);
@Percept
public void _handle_Initialize_0(final Initialize occurrence) {
Object _get = occurrence.parameters[0];
this.environment = ((Environment) _get);
Object _get_1 = occurrence.parameters[1];
UUID spaceId = ((UUID) _get_1);
AgentContext _defaultContext = this.getDefaultContext();
OpenEventSpace _space = _defaultContext.<OpenEventSpace>getSpace(spaceId);
this.space = _space;
EventListener _asEventListener = this.asEventListener();
this.space.register(_asEventListener);
UUID _iD = this.getID();
Address _address = this.space.getAddress(_iD);
this.myAdr = _address;
SimulationAgentReady _simulationAgentReady = new SimulationAgentReady();
this.emit(_simulationAgentReady);
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@Pure
private boolean _eventhandler_guard_InfluenceEvent_1(final InfluenceEvent it, final InfluenceEvent occurrence) {
boolean _get = this.freeze.get();
boolean _not = (!_get);
return _not;
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
private void _eventhandler_body_InfluenceEvent_1(final InfluenceEvent occurrence) {
UUID id = occurrence.influence.getEmitter();
if ((id == null)) {
Address _source = occurrence.getSource();
UUID _uUID = _source.getUUID();
id = _uUID;
}
AgentBody body = this.environment.getAgentBodyFor(id);
body.influence(occurrence.influence);
this.influences++;
int _agentBodyNumber = this.environment.getAgentBodyNumber();
boolean _greaterEqualsThan = (this.influences >= _agentBodyNumber);
if (_greaterEqualsThan) {
this.runEnvironmentBehavior();
}
}
@Percept
public void _handle_InfluenceEvent_1(final InfluenceEvent occurrence) {
if (_eventhandler_guard_InfluenceEvent_1(occurrence, occurrence)) {
_eventhandler_body_InfluenceEvent_1(occurrence);
}
}
@Percept
public void _handle_StopSimulation_2(final StopSimulation occurrence) {
this.killMe();
}
@Percept
public void _handle_StartSimulation_3(final StartSimulation occurrence) {
this.runEnvironmentBehavior();
}
protected void runEnvironmentBehavior() {
try {
this.freeze.set(true);
this.influences = 0;
this.environment.runBehaviour();
TimeManager _timeManager = this.environment.getTimeManager();
float _simulationDelay = _timeManager.getSimulationDelay();
long delay = ((long) _simulationDelay);
if ((delay > 0)) {
Thread.sleep(delay);
}
this.freeze.set(false);
this.notifyAgentsOrDie();
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
protected void notifyAgentsOrDie() {
boolean run = false;
TimeManager _timeManager = this.environment.getTimeManager();
float _currentTime = _timeManager.getCurrentTime();
TimeManager _timeManager_1 = this.environment.getTimeManager();
float _lastStepDuration = _timeManager_1.getLastStepDuration();
final TimePercept timePercept = new TimePercept(_currentTime, _lastStepDuration);
Iterable<? extends AgentBody> _agentBodies = this.environment.getAgentBodies();
for (final AgentBody body : _agentBodies) {
{
run = true;
List<fr.utbm.info.vi51.framework.environment.Percept> _perceivedObjects = body.getPerceivedObjects();
fr.utbm.info.vi51.framework.environment.Percept _percept = new fr.utbm.info.vi51.framework.environment.Percept(body);
PerceptionEvent event = new PerceptionEvent(_perceivedObjects, _percept, timePercept);
event.setSource(this.myAdr);
UUID _iD = body.getID();
AddressUUIDScope _addressUUIDScope = new AddressUUIDScope(_iD);
this.space.emit(event, _addressUUIDScope);
}
}
if ((!run)) {
this.killMe();
}
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0, final Scope<Address> arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultAddress()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultAddress()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected Address getDefaultAddress() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultAddress();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultContext()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultContext()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected AgentContext getDefaultContext() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultContext();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultSpace()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultSpace()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected EventSpace getDefaultSpace() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultSpace();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final AgentContext arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final Space arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final SpaceID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isInDefaultSpace(final Event arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isInDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void receive(final UUID arg0, final Event arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).receive(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])}.
*
* @see io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected UUID spawn(final Class<? extends Agent> arg0, final Object... arg1) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).spawn(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#killMe()}.
*
* @see io.sarl.core.Lifecycle#killMe()
*/
@EarlyExit
@FiredEvent({ AgentKilled.class, Destroy.class })
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected void killMe() {
getSkill(io.sarl.core.Lifecycle.class).killMe();
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#spawnInContext(java.lang.Class<? extends io.sarl.lang.core.Agent>,io.sarl.lang.core.AgentContext,java.lang.Object[])}.
*
* @see io.sarl.core.Lifecycle#spawnInContext(java.lang.Class<? extends io.sarl.lang.core.Agent>,io.sarl.lang.core.AgentContext,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected UUID spawnInContext(final Class<? extends Agent> arg0, final AgentContext arg1, final Object... arg2) {
return getSkill(io.sarl.core.Lifecycle.class).spawnInContext(arg0, arg1, arg2);
}
/**
* See the capacity {@link io.sarl.core.Lifecycle#spawnInContextWithID(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.util.UUID,io.sarl.lang.core.AgentContext,java.lang.Object[])}.
*
* @see io.sarl.core.Lifecycle#spawnInContextWithID(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.util.UUID,io.sarl.lang.core.AgentContext,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Lifecycle.class)
protected UUID spawnInContextWithID(final Class<? extends Agent> arg0, final UUID arg1, final AgentContext arg2, final Object... arg3) {
return getSkill(io.sarl.core.Lifecycle.class).spawnInContextWithID(arg0, arg1, arg2, arg3);
}
/**
* See the capacity {@link io.sarl.core.Behaviors#asEventListener()}.
*
* @see io.sarl.core.Behaviors#asEventListener()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected EventListener asEventListener() {
return getSkill(io.sarl.core.Behaviors.class).asEventListener();
}
/**
* See the capacity {@link io.sarl.core.Behaviors#registerBehavior(io.sarl.lang.core.Behavior)}.
*
* @see io.sarl.core.Behaviors#registerBehavior(io.sarl.lang.core.Behavior)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected Behavior registerBehavior(final Behavior arg0) {
return getSkill(io.sarl.core.Behaviors.class).registerBehavior(arg0);
}
/**
* See the capacity {@link io.sarl.core.Behaviors#unregisterBehavior(io.sarl.lang.core.Behavior)}.
*
* @see io.sarl.core.Behaviors#unregisterBehavior(io.sarl.lang.core.Behavior)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected Behavior unregisterBehavior(final Behavior arg0) {
return getSkill(io.sarl.core.Behaviors.class).unregisterBehavior(arg0);
}
/**
* See the capacity {@link io.sarl.core.Behaviors#wake(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.Behaviors#wake(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Behaviors.class)
protected void wake(final Event arg0) {
getSkill(io.sarl.core.Behaviors.class).wake(arg0);
}
/**
* Construct an agent.
* @param builtinCapacityProvider - provider of the built-in capacities.
* @param parentID - identifier of the parent. It is the identifier of the parent agent and the enclosing contect, at the same time.
* @param agentID - identifier of the agent. If <code>null</code> the agent identifier will be computed randomly.
*/
@Inject
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public EnvironmentAgent(final BuiltinCapacitiesProvider builtinCapacityProvider, final UUID parentID, final UUID agentID) {
super(builtinCapacityProvider, parentID, agentID);
}
}

+ 65
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/InfluenceEvent.java View File

@@ -0,0 +1,65 @@
package fr.utbm.info.vi51.framework.environment;

import fr.utbm.info.vi51.framework.environment.Influence;
import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Event;
import javax.annotation.Generated;
import org.eclipse.xtext.xbase.lib.Pure;

/**
* This event contains an influence
*
* @author St&eacute;phane GALLAND &lt;stephane.galland@utbm.fr&gt;
*/
@SarlSpecification("0.3")
@SuppressWarnings("all")
public class InfluenceEvent extends Event {
public final Influence influence;
public InfluenceEvent(final Influence e) {
this.influence = e;
}
@Override
@Pure
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
InfluenceEvent other = (InfluenceEvent) obj;
if (this.influence == null) {
if (other.influence != null)
return false;
} else if (!this.influence.equals(other.influence))
return false;
return super.equals(obj);
}
@Override
@Pure
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((this.influence== null) ? 0 : this.influence.hashCode());
return result;
}
/**
* Returns a String representation of the InfluenceEvent event's attributes only.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@Pure
protected String attributesToString() {
StringBuilder result = new StringBuilder(super.attributesToString());
result.append("influence = ").append(this.influence);
return result.toString();
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
private final static long serialVersionUID = 2017820346L;
}

+ 87
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/PerceptionEvent.java View File

@@ -0,0 +1,87 @@
package fr.utbm.info.vi51.framework.environment;

import fr.utbm.info.vi51.framework.environment.Percept;
import fr.utbm.info.vi51.framework.time.TimePercept;
import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Event;
import java.util.List;
import javax.annotation.Generated;
import org.eclipse.xtext.xbase.lib.Pure;

/**
* This event contains percepts.
*
* @author St&eacute;phane GALLAND &lt;stephane.galland@utbm.fr&gt;
*/
@SarlSpecification("0.3")
@SuppressWarnings("all")
public class PerceptionEvent extends Event {
public final Percept body;
public final TimePercept time;
public final List<Percept> perceptions;
public PerceptionEvent(final List<Percept> p, final Percept b, final TimePercept t) {
this.perceptions = p;
this.body = b;
this.time = t;
}
@Override
@Pure
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PerceptionEvent other = (PerceptionEvent) obj;
if (this.body == null) {
if (other.body != null)
return false;
} else if (!this.body.equals(other.body))
return false;
if (this.time == null) {
if (other.time != null)
return false;
} else if (!this.time.equals(other.time))
return false;
if (this.perceptions == null) {
if (other.perceptions != null)
return false;
} else if (!this.perceptions.equals(other.perceptions))
return false;
return super.equals(obj);
}
@Override
@Pure
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((this.body== null) ? 0 : this.body.hashCode());
result = prime * result + ((this.time== null) ? 0 : this.time.hashCode());
result = prime * result + ((this.perceptions== null) ? 0 : this.perceptions.hashCode());
return result;
}
/**
* Returns a String representation of the PerceptionEvent event's attributes only.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@Pure
protected String attributesToString() {
StringBuilder result = new StringBuilder(super.attributesToString());
result.append("body = ").append(this.body);
result.append("time = ").append(this.time);
result.append("perceptions = ").append(this.perceptions);
return result.toString();
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
private final static long serialVersionUID = 2892685776L;
}

+ 35
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/SimulationAgentReady.java View File

@@ -0,0 +1,35 @@
package fr.utbm.info.vi51.framework.environment;

import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Event;
import javax.annotation.Generated;

/**
* This event is fired when a simulation agent is ready.
*
* @author St&eacute;phane GALLAND &lt;stephane.galland@utbm.fr&gt;
*/
@SarlSpecification("0.3")
@SuppressWarnings("all")
public class SimulationAgentReady extends Event {
/**
* Construct an event. The source of the event is unknown.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public SimulationAgentReady() {
super();
}
/**
* Construct an event.
* @param source - address of the agent that is emitting this event.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public SimulationAgentReady(final Address source) {
super(source);
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
private final static long serialVersionUID = 588368462L;
}

+ 35
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/StartSimulation.java View File

@@ -0,0 +1,35 @@
package fr.utbm.info.vi51.framework.environment;

import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Event;
import javax.annotation.Generated;

/**
* This event is for starting the simulation.
*
* @author St&eacute;phane GALLAND &lt;stephane.galland@utbm.fr&gt;
*/
@SarlSpecification("0.3")
@SuppressWarnings("all")
public class StartSimulation extends Event {
/**
* Construct an event. The source of the event is unknown.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public StartSimulation() {
super();
}
/**
* Construct an event.
* @param source - address of the agent that is emitting this event.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public StartSimulation(final Address source) {
super(source);
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
private final static long serialVersionUID = 588368462L;
}

+ 35
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/framework/environment/StopSimulation.java View File

@@ -0,0 +1,35 @@
package fr.utbm.info.vi51.framework.environment;

import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Event;
import javax.annotation.Generated;

/**
* This event is for stopping the simulation.
*
* @author St&eacute;phane GALLAND &lt;stephane.galland@utbm.fr&gt;
*/
@SarlSpecification("0.3")
@SuppressWarnings("all")
public class StopSimulation extends Event {
/**
* Construct an event. The source of the event is unknown.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public StopSimulation() {
super();
}
/**
* Construct an event.
* @param source - address of the agent that is emitting this event.
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
public StopSimulation(final Address source) {
super(source);
}
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
private final static long serialVersionUID = 588368462L;
}

+ 421
- 0
VI51-TP3/src/main/generated-sources/sarl/fr/utbm/info/vi51/labwork2/agent/Rabbit.java View File

@@ -0,0 +1,421 @@
package fr.utbm.info.vi51.labwork2.agent;

import com.google.common.base.Objects;
import fr.utbm.info.vi51.framework.agent.AbstractAnimat;
import fr.utbm.info.vi51.framework.agent.BehaviourOutput;
import fr.utbm.info.vi51.framework.environment.DynamicType;
import fr.utbm.info.vi51.framework.environment.PerceptionEvent;
import fr.utbm.info.vi51.framework.environment.SimulationAgentReady;
import fr.utbm.info.vi51.framework.math.MathUtil;
import fr.utbm.info.vi51.framework.math.Point2f;
import fr.utbm.info.vi51.framework.math.Vector2f;
import fr.utbm.info.vi51.labwork2.behavior.AlignBehaviour;
import fr.utbm.info.vi51.labwork2.behavior.SeekBehaviour;
import fr.utbm.info.vi51.labwork2.behavior.WanderBehaviour;
import fr.utbm.info.vi51.labwork2.behavior.kinematic.KinematicAlignBehaviour;
import fr.utbm.info.vi51.labwork2.behavior.kinematic.KinematicSeekBehaviour;
import fr.utbm.info.vi51.labwork2.behavior.kinematic.KinematicWanderBehaviour;
import fr.utbm.info.vi51.labwork2.behavior.steering.SteeringSeekBehaviour;
import io.sarl.core.AgentSpawned;
import io.sarl.core.DefaultContextInteractions;
import io.sarl.core.Initialize;
import io.sarl.core.Logging;
import io.sarl.lang.annotation.FiredEvent;
import io.sarl.lang.annotation.ImportedCapacityFeature;
import io.sarl.lang.annotation.SarlSpecification;
import io.sarl.lang.core.Address;
import io.sarl.lang.core.Agent;
import io.sarl.lang.core.AgentContext;
import io.sarl.lang.core.BuiltinCapacitiesProvider;
import io.sarl.lang.core.Event;
import io.sarl.lang.core.EventSpace;
import io.sarl.lang.core.Percept;
import io.sarl.lang.core.Scope;
import io.sarl.lang.core.Space;
import io.sarl.lang.core.SpaceID;
import java.io.Serializable;
import java.util.UUID;
import javax.annotation.Generated;
import javax.inject.Inject;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;

@SarlSpecification("0.3")
@SuppressWarnings("all")
public class Rabbit extends AbstractAnimat {
protected SeekBehaviour seekBehaviour;
protected AlignBehaviour alignBehaviour;
protected WanderBehaviour wanderBehaviour;
protected final float STOP_RADIUS = (MathUtil.PI / 10f);
protected final float SLOW_RADIUS = (MathUtil.PI / 4f);
protected final float WANDER_CIRCLE_DISTANCE = 20f;
protected final float WANDER_CIRCLE_RADIUS = 10f;
protected final float WANDER_MAX_ROTATION = (MathUtil.PI / 4f);
@Percept
public void _handle_Initialize_0(final Initialize occurrence) {
super._handle_Initialize_0(occurrence);
boolean _equals = Objects.equal(this.behaviorType, DynamicType.STEERING);
if (_equals) {
SteeringSeekBehaviour _steeringSeekBehaviour = new SteeringSeekBehaviour();
this.seekBehaviour = _steeringSeekBehaviour;
} else {
KinematicSeekBehaviour _kinematicSeekBehaviour = new KinematicSeekBehaviour();
this.seekBehaviour = _kinematicSeekBehaviour;
KinematicAlignBehaviour _kinematicAlignBehaviour = new KinematicAlignBehaviour();
this.alignBehaviour = _kinematicAlignBehaviour;
KinematicWanderBehaviour _kinematicWanderBehaviour = new KinematicWanderBehaviour();
this.wanderBehaviour = _kinematicWanderBehaviour;
}
SimulationAgentReady _simulationAgentReady = new SimulationAgentReady();
this.emit(_simulationAgentReady);
}
@Percept
public void _handle_PerceptionEvent_1(final PerceptionEvent occurrence) {
final Function1<fr.utbm.info.vi51.framework.environment.Percept, Boolean> _function = (fr.utbm.info.vi51.framework.environment.Percept it) -> {
Serializable _type = it.getType();
return Boolean.valueOf(Objects.equal(_type, "TARGET"));
};
fr.utbm.info.vi51.framework.environment.Percept mouseTarget = IterableExtensions.<fr.utbm.info.vi51.framework.environment.Percept>findFirst(occurrence.perceptions, _function);
if ((mouseTarget != null)) {
Vector2f _direction = occurrence.body.getDirection();
float _currentAngularSpeed = occurrence.body.getCurrentAngularSpeed();
float _maxAngularSpeed = occurrence.body.getMaxAngularSpeed();
Vector2f _direction_1 = mouseTarget.getDirection();
BehaviourOutput b = this.alignBehaviour.runAlign(_direction, _currentAngularSpeed, _maxAngularSpeed, _direction_1);
this.println(b);
float _angular = b.getAngular();
boolean _lessThan = (_angular < 1);
if (_lessThan) {
Point2f _position = occurrence.body.getPosition();
float _currentLinearSpeed = occurrence.body.getCurrentLinearSpeed();
float _maxLinearSpeed = occurrence.body.getMaxLinearSpeed();
Point2f _position_1 = mouseTarget.getPosition();
BehaviourOutput _runSeek = this.seekBehaviour.runSeek(_position, _currentLinearSpeed, _maxLinearSpeed, _position_1);
this.emitInfluence(_runSeek);
} else {
this.emitInfluence(b);
}
} else {
this.doNothing();
}
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)}.
*
* @see io.sarl.core.DefaultContextInteractions#emit(io.sarl.lang.core.Event,io.sarl.lang.core.Scope<io.sarl.lang.core.Address>)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void emit(final Event arg0, final Scope<Address> arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).emit(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultAddress()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultAddress()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected Address getDefaultAddress() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultAddress();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultContext()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultContext()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected AgentContext getDefaultContext() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultContext();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#getDefaultSpace()}.
*
* @see io.sarl.core.DefaultContextInteractions#getDefaultSpace()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected EventSpace getDefaultSpace() {
return getSkill(io.sarl.core.DefaultContextInteractions.class).getDefaultSpace();
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(io.sarl.lang.core.AgentContext)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final AgentContext arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultContext(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultContext(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultContext(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.Space)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final Space arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(io.sarl.lang.core.SpaceID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final SpaceID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)}.
*
* @see io.sarl.core.DefaultContextInteractions#isDefaultSpace(java.util.UUID)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isDefaultSpace(final UUID arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#isInDefaultSpace(io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected boolean isInDefaultSpace(final Event arg0) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).isInDefaultSpace(arg0);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)}.
*
* @see io.sarl.core.DefaultContextInteractions#receive(java.util.UUID,io.sarl.lang.core.Event)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected void receive(final UUID arg0, final Event arg1) {
getSkill(io.sarl.core.DefaultContextInteractions.class).receive(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])}.
*
* @see io.sarl.core.DefaultContextInteractions#spawn(java.lang.Class<? extends io.sarl.lang.core.Agent>,java.lang.Object[])
*/
@FiredEvent(AgentSpawned.class)
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(DefaultContextInteractions.class)
protected UUID spawn(final Class<? extends Agent> arg0, final Object... arg1) {
return getSkill(io.sarl.core.DefaultContextInteractions.class).spawn(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.Logging#debug(java.lang.Object)}.
*
* @see io.sarl.core.Logging#debug(java.lang.Object)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Logging.class)
protected void debug(final Object arg0) {
getSkill(io.sarl.core.Logging.class).debug(arg0);
}
/**
* See the capacity {@link io.sarl.core.Logging#error(java.lang.Object)}.
*
* @see io.sarl.core.Logging#error(java.lang.Object)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Logging.class)
protected void error(final Object arg0) {
getSkill(io.sarl.core.Logging.class).error(arg0);
}
/**
* See the capacity {@link io.sarl.core.Logging#error(java.lang.Object,java.lang.Throwable)}.
*
* @see io.sarl.core.Logging#error(java.lang.Object,java.lang.Throwable)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Logging.class)
protected void error(final Object arg0, final Throwable arg1) {
getSkill(io.sarl.core.Logging.class).error(arg0, arg1);
}
/**
* See the capacity {@link io.sarl.core.Logging#getLogLevel()}.
*
* @see io.sarl.core.Logging#getLogLevel()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Logging.class)
protected int getLogLevel() {
return getSkill(io.sarl.core.Logging.class).getLogLevel();
}
/**
* See the capacity {@link io.sarl.core.Logging#info(java.lang.Object)}.
*
* @see io.sarl.core.Logging#info(java.lang.Object)
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Logging.class)
protected void info(final Object arg0) {
getSkill(io.sarl.core.Logging.class).info(arg0);
}
/**
* See the capacity {@link io.sarl.core.Logging#isDebugLogEnabled()}.
*
* @see io.sarl.core.Logging#isDebugLogEnabled()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Logging.class)
protected boolean isDebugLogEnabled() {
return getSkill(io.sarl.core.Logging.class).isDebugLogEnabled();
}
/**
* See the capacity {@link io.sarl.core.Logging#isErrorLogEnabled()}.
*
* @see io.sarl.core.Logging#isErrorLogEnabled()
*/
@Generated("io.sarl.lang.jvmmodel.SARLJvmModelInferrer")
@ImportedCapacityFeature(Logging.class)
protected boolean isErrorLogEnabled() {
return getSkill(io.sarl.core.Logging.class).isErrorLogEnabled();
}
/**
* See the capacity {@link io.sarl.core.Logging#isInfoLogEnabled()}.
*