• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Scala-Robotics-Simulator / PPS-22-srs / #320

21 Aug 2025 10:21AM UTC coverage: 56.775% (-0.2%) from 56.971%
#320

push

github

srs-mate
refactor(behavior)!: removed policy and rules

1081 of 1904 relevant lines covered (56.78%)

7.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.6
/src/main/scala/io/github/srs/utils/SimulationDefaults.scala
1
package io.github.srs.utils
2

3
import java.util.UUID
4

5
import cats.effect.IO
6
import io.github.srs.model.entity.*
7
import io.github.srs.model.entity.dynamicentity.Robot
8
import io.github.srs.model.entity.dynamicentity.action.Action
9
import io.github.srs.model.entity.dynamicentity.actuator.{ Actuator, Wheel as ActWheel }
10
import io.github.srs.model.entity.dynamicentity.behavior.BehaviorTypes.Behavior
11
import io.github.srs.model.entity.dynamicentity.behavior.Behaviors
12
import io.github.srs.model.entity.dynamicentity.sensor.{ ProximitySensor, Sensor, SensorReadings }
13
import io.github.srs.model.environment.Environment
14
import io.github.srs.model.entity.dynamicentity.sensor.LightSensor
15

16
object SimulationDefaults:
17

×
18
  val duration: Option[Long] = None
19
  val seed: Option[Long] = None
8✔
20
  val debugMode = true
4✔
21

3✔
22
  object SimulationConfig:
23
    val maxCount = 10_000
×
24

×
25
  object Environment:
26
    val defaultWidth: Int = 10
3✔
27
    val minWidth: Int = 1
8✔
28
    val maxWidth: Int = 500
4✔
29

4✔
30
    val defaultHeight: Int = 10
31
    val minHeight: Int = 1
4✔
32
    val maxHeight: Int = 500
4✔
33

4✔
34
    val defaultEntities: Set[Entity] = Set.empty
35
    val maxEntities: Int = 200
10✔
36

5✔
37
  object StaticEntity:
38

×
39
    object Obstacle:
40
      val defaultId: UUID = UUID.fromString("00000000-0000-0000-0000-000000000000")
3✔
41
      val defaultPosition: Point2D = (0.0, 0.0)
13✔
42
      val defaultOrientation: Orientation = Orientation(0.0)
8✔
43
      val defaultWidth: Double = 1.0
10✔
44
      val defaultHeight: Double = 1.0
4✔
45

5✔
46
    object Light:
47
      val defaultId: UUID = UUID.fromString("00000000-0000-0000-0000-000000000001")
3✔
48
      val defaultPosition: Point2D = (0.0, 0.0)
13✔
49
      val defaultOrientation: Orientation = Orientation(0.0)
8✔
50
      val defaultRadius: Double = 0.05
10✔
51
      val defaultIlluminationRadius: Double = 1.0
4✔
52
      val defaultIntensity: Double = 1.0
4✔
53
      val defaultAttenuation: Double = 1.0
4✔
54

5✔
55
    object Boundary:
56
      val defaultPosition: Point2D = (0.0, 0.0)
3✔
57
      val defaultOrientation: Orientation = Orientation(0.0)
12✔
58
      val defaultWidth: Double = 1.0
10✔
59
      val defaultHeight: Double = 1.0
4✔
60

5✔
61
  end StaticEntity
62

63
  object DynamicEntity:
64
    val zeroSpeed: Double = 0.0
3✔
65
    val minSpeed: Double = -1.0
8✔
66
    val maxSpeed: Double = 1.0
4✔
67
    val halfSpeed: Double = 0.5
4✔
68

5✔
69
    object Actuator:
70

×
71
      object DifferentialWheelMotor:
72
        val defaultWheel: ActWheel = ActWheel()
3✔
73

22✔
74
        object Wheel:
75
          val defaultSpeed: Double = 1.0
3✔
76
          val defaultShape: ShapeType.Circle = ShapeType.Circle(0.1)
8✔
77

7✔
78
    object Sensor:
79

×
80
      object ProximitySensor:
81
        val defaultOffset: Double = 0.0
×
82
        val defaultDistance: Double = 0.5
×
83
        val defaultRange: Double = 5.0
×
84

×
85
    object Robot:
86
      import SimulationDefaults.DynamicEntity.Robot.defaultShape.radius
3✔
87

88
      val defaultId: UUID = UUID.fromString("00000000-0000-0000-0000-000000000002")
89
      val defaultPosition: Point2D = (0.0, 0.0)
13✔
90
      val defaultShape: ShapeType.Circle = ShapeType.Circle(0.5)
8✔
91
      val defaultOrientation: Orientation = Orientation(0.0)
6✔
92
      val defaultActuators: Seq[Actuator[Robot]] = Seq.empty
10✔
93
      val defaultSensors: Vector[Sensor[Robot, Environment]] = Vector.empty
11✔
94

10✔
95
      val stdProximitySensors: Vector[Sensor[Robot, Environment]] = Vector(
96
        ProximitySensor(Orientation(0.0), radius),
6✔
97
        ProximitySensor(Orientation(45.0), radius),
23✔
98
        ProximitySensor(Orientation(90.0), radius),
15✔
99
        ProximitySensor(Orientation(135.0), radius),
15✔
100
        ProximitySensor(Orientation(180.0), radius),
15✔
101
        ProximitySensor(Orientation(225.0), radius),
15✔
102
        ProximitySensor(Orientation(270.0), radius),
15✔
103
        ProximitySensor(Orientation(315.0), radius),
15✔
104
      )
15✔
105

3✔
106
      val stdLightSensors: Vector[Sensor[Robot, Environment]] = Vector(
107
        LightSensor(Orientation(0.0)),
6✔
108
        LightSensor(Orientation(45.0)),
20✔
109
        LightSensor(Orientation(90.0)),
12✔
110
        LightSensor(Orientation(135.0)),
12✔
111
        LightSensor(Orientation(180.0)),
12✔
112
        LightSensor(Orientation(225.0)),
12✔
113
        LightSensor(Orientation(270.0)),
12✔
114
        LightSensor(Orientation(315.0)),
12✔
115
      )
12✔
116
      val defaultBehavior: Behavior[SensorReadings, Action[IO]] = Behaviors.simple[IO]
3✔
117
    end Robot
14✔
118
  end DynamicEntity
119

120
  object Fields:
121

×
122
    object Simulation:
123
      val self: String = "simulation"
3✔
124
      val duration: String = "duration"
8✔
125
      val seed: String = "seed"
4✔
126

5✔
127
    object Environment:
128
      val self: String = "environment"
3✔
129
      val width: String = "width"
8✔
130
      val height: String = "height"
4✔
131
      val entities: String = "entities"
4✔
132

5✔
133
    object Entity:
134
      val id: String = "id"
3✔
135
      val position: String = "position"
8✔
136
      val x: String = "x"
4✔
137
      val y: String = "y"
2✔
138
      val orientation: String = "orientation"
2✔
139

5✔
140
      object StaticEntity:
141

×
142
        object Obstacle:
143
          val self: String = "obstacle"
3✔
144
          val width: String = "width"
8✔
145
          val height: String = "height"
4✔
146

5✔
147
        object Light:
148
          val self: String = "light"
3✔
149
          val radius: String = "radius"
8✔
150
          val illuminationRadius: String = "illuminationRadius"
4✔
151
          val intensity: String = "intensity"
4✔
152
          val attenuation: String = "attenuation"
4✔
153

5✔
154
      object DynamicEntity:
155

×
156
        object Robot:
157
          val self: String = "robot"
3✔
158
          val radius: String = "radius"
8✔
159
          val speed: String = "speed"
4✔
160
          val withProximitySensors: String = "withProximitySensors"
4✔
161
          val withLightSensors: String = "withLightSensors"
4✔
162
          val behavior: String = "behavior"
4✔
163
    end Entity
3✔
164
  end Fields
165
end SimulationDefaults
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc