io.github.srs.model.entity.dynamicentity.sensor

Members list

Type members

Classlikes

final case class LightSensor[Entity <: DynamicEntity, Env <: Environment](offset: Orientation) extends Sensor[Entity, Env]

A light sensor that senses the light intensity in the environment.

A light sensor that senses the light intensity in the environment.

Type parameters

Entity

the type of dynamic entity that the sensor can act upon.

Env

the type of environment in which the sensor operates.

Value parameters

offset

the offset orientation of the sensor relative to the entity's orientation.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Sensor[Entity, Env]
class Object
trait Matchable
class Any
Show all
final case class ProximitySensor[Entity <: DynamicEntity, Env <: Environment](offset: Orientation, range: Range) extends Sensor[Entity, Env]

A proximity sensor that can sense the distance to other entities in the environment. It calculates the distance to the nearest entity within its range and returns a normalized value. The value is normalized to a range between 0.0 (closest) and 1.0 (farthest).

A proximity sensor that can sense the distance to other entities in the environment. It calculates the distance to the nearest entity within its range and returns a normalized value. The value is normalized to a range between 0.0 (closest) and 1.0 (farthest).

Type parameters

Entity

the type of dynamic entity that the sensor can act upon.

Env

the type of environment in which the sensor operates.

Value parameters

offset

the offset orientation of the sensor relative to the entity's orientation.

range

the range of the sensor, which defines how far it can sense.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Sensor[Entity, Env]
class Object
trait Matchable
class Any
Show all
trait Sensor[-Entity <: DynamicEntity, -Env <: Environment]

Represents a sensor that can sense the environment for a dynamic entity.

Represents a sensor that can sense the environment for a dynamic entity.

Type parameters

Entity

the type of dynamic entity that the sensor can act upon.

Env

the type of environment in which the sensor operates.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class LightSensor[Entity, Env]
class ProximitySensor[Entity, Env]
object Sensor

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Sensor.type
final case class SensorReading[S <: Sensor[_, _], A](sensor: S, value: A)

Represents a reading from a sensor. This case class encapsulates the sensor and the value it has sensed.

Represents a reading from a sensor. This case class encapsulates the sensor and the value it has sensed.

Type parameters

A

the type of data sensed by the sensor.

S

the type of sensor, which is a subtype of Sensor.

Value parameters

sensor

the sensor that has taken the reading.

value

the value sensed by the sensor.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Types

type LightReadings = Vector[SensorReading[LightSensor[_, _], LightSensor[_, _]#Data]]

A collection of light sensor readings. This type is a specialized version of SensorReadings, specifically for light sensors. It is a vector of SensorReading instances where the sensor is a LightSensor and the data is of type Double.

A collection of light sensor readings. This type is a specialized version of SensorReadings, specifically for light sensors. It is a vector of SensorReading instances where the sensor is a LightSensor and the data is of type Double.

Attributes

A collection of proximity sensor readings. This type is a specialized version of SensorReadings, specifically for proximity sensors. It is a vector of SensorReading instances where the sensor is a ProximitySensor and the data is of type Double.

A collection of proximity sensor readings. This type is a specialized version of SensorReadings, specifically for proximity sensors. It is a vector of SensorReading instances where the sensor is a ProximitySensor and the data is of type Double.

Attributes

type Range = Double

Represents the range of a sensor.

Represents the range of a sensor.

Attributes

type SensorReadings = Vector[SensorReading[_ <: Sensor[_, _], _]]

A collection of sensor readings. This type is used to represent multiple sensor readings from a dynamic entity. It is a vector of SensorReading instances, allowing for efficient access and manipulation of sensor data.

A collection of sensor readings. This type is used to represent multiple sensor readings from a dynamic entity. It is a vector of SensorReading instances, allowing for efficient access and manipulation of sensor data.

Attributes