AgentDsl
The DSL for creating and configuring an Agent entity.
Attributes
- Example
-
import io.github.srs.model.entity.dynamicentity.agent.dsl.AgentDsl.* val myAgent = agent at Point2D(1.0, 2.0) withShape ShapeType.Circle(0.5) withOrientation Orientation(90.0) containing WheelMotor() withSensors SensorSuite.empty myAgent.validate match case Right(validAgent) => println(s"Valid agent: $validAgent") case Left(error) => println(s"Validation error: $error.errorMessage") - Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AgentDsl.type
Members list
Value members
Concrete methods
Creates a new Agent with default properties.
Creates a new Agent with default properties.
Attributes
Validates an Agent entity to ensure it meets the domain constraints.
Validates an Agent entity to ensure it meets the domain constraints.
Value parameters
- a
-
the Agent entity to validate.
Attributes
- Returns
-
Right if the agent is valid, or Left with a validation
Validates a Sensor to ensure it meets the domain constraints.
Validates a Sensor to ensure it meets the domain constraints.
Value parameters
- sensor
-
the Sensor to validate.
Attributes
- Returns
-
Right if the sensor is valid, or Left with a validation error.
Extensions
Extensions
Another way to add an actuator to the agent.
Another way to add an actuator to the agent.
Value parameters
- actuator
-
the actuator to add.
Attributes
- Returns
-
a new Agent instance with the actuator added.
Adds a sensor to the agent.
Adds a sensor to the agent.
Value parameters
- sensor
-
the sensor to add.
Attributes
- Returns
-
a new Agent instance with the sensor added.
Sets the position of the agent.
Sets the position of the agent.
Value parameters
- position
-
the new position of the agent.
Attributes
- Returns
-
a new Agent instance with the updated position.
Adds an actuator to the agent.
Adds an actuator to the agent.
Value parameters
- actuator
-
the actuator to add.
Attributes
- Returns
-
a new Agent instance with the actuator added.
Adds a sensor to the agent.
Adds a sensor to the agent.
Value parameters
- sensor
-
the sensor to add.
Attributes
- Returns
-
a new Agent instance with the sensor added.
Validates the agent entity to ensure it meets the domain constraints.
Validates the agent entity to ensure it meets the domain constraints.
Attributes
- Returns
-
Right if the agent is valid, or Left with a validation error message if it is not.
Adds an actuator to the agent.
Adds an actuator to the agent.
Value parameters
- actuator
-
the actuator to add.
Attributes
- Returns
-
a new Agent instance with the actuator added.
Sets the actuators of the agent.
Sets the actuators of the agent.
Value parameters
- actuators
-
the new sequence of actuators for the agent.
Attributes
- Returns
-
a new Agent instance with the updated actuators.
Extension methods for Agent to allow DSL-like configuration.
Extension methods for Agent to allow DSL-like configuration.
Attributes
Extension methods for Agent to allow DSL-like configuration.
Extension methods for Agent to allow DSL-like configuration.
Attributes
Sets the orientation of the agent.
Sets the orientation of the agent.
Value parameters
- orientation
-
the new orientation of the agent.
Attributes
- Returns
-
a new Agent instance with the updated orientation.
Extension methods for Agent to allow DSL-like configuration.
Extension methods for Agent to allow DSL-like configuration.
Attributes
Extension methods for Agent to allow DSL-like configuration.
Extension methods for Agent to allow DSL-like configuration.
Attributes
Adds a sensor to the agent.
Adds a sensor to the agent.
Value parameters
- sensor
-
the sensor to add.
Attributes
- Returns
-
a new Agent instance with the sensor added.
Sets the sensors of the agent.
Sets the sensors of the agent.
Value parameters
- sensors
-
the new sequence of sensors for the agent.
Attributes
- Returns
-
a new Agent instance with the updated sensors.
Sets the shape of the agent.
Sets the shape of the agent.
Value parameters
- shape
-
the new shape of the agent.
Attributes
- Returns
-
a new Agent instance with the updated shape.
Extension methods for Agent to allow DSL-like configuration.
Extension methods for Agent to allow DSL-like configuration.
Attributes
Extension methods for Agent to allow DSL-like configuration.
Extension methods for Agent to allow DSL-like configuration.
Attributes
Extension methods for Agent to allow DSL-like configuration.
Extension methods for Agent to allow DSL-like configuration.