ProximitySensor

io.github.srs.model.entity.dynamicentity.sensor.ProximitySensor
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).

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

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Sensor[Entity, Env]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type Data = Double

The type of data that the sensor returns. This type can vary based on the specific sensor implementation.

The type of data that the sensor returns. This type can vary based on the specific sensor implementation.

Attributes

Value members

Concrete methods

override def sense[F[_] : Monad](entity: Entity, env: Env): F[Data]

Senses the environment for the given entity and returns the data collected by the sensor.

Senses the environment for the given entity and returns the data collected by the sensor.

Type parameters

F

the effect type in which the sensing operation is performed.

Value parameters

entity

the dynamic entity that the sensor is attached to.

env

the environment in which the sensor operates.

Attributes

Returns

a monadic effect containing the data sensed by the sensor.

Definition Classes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product