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

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

22 Aug 2025 12:35PM UTC coverage: 57.15% (+0.4%) from 56.785%
#345

push

github

srs-mate
refactor: make behaviors to policy companion object

14 of 15 new or added lines in 1 file covered. (93.33%)

105 existing lines in 9 files now uncovered.

1107 of 1937 relevant lines covered (57.15%)

7.99 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 io.github.srs.model.entity.*
6
import io.github.srs.model.entity.dynamicentity.Robot
7
import io.github.srs.model.entity.dynamicentity.actuator.{ Actuator, Wheel as ActWheel }
8
import io.github.srs.model.entity.dynamicentity.sensor.{ ProximitySensor, Sensor }
9
import io.github.srs.model.environment.Environment
10
import io.github.srs.model.entity.dynamicentity.sensor.LightSensor
11
import io.github.srs.model.entity.dynamicentity.behavior.Policy
12

13
object SimulationDefaults:
UNCOV
14

×
15
  val duration: Option[Long] = None
16
  val seed: Option[Long] = None
8✔
17
  val debugMode = true
4✔
18

3✔
19
  object SimulationConfig:
UNCOV
20
    val maxCount = 10_000
×
UNCOV
21

×
22
  object Environment:
23
    val defaultWidth: Int = 10
3✔
24
    val minWidth: Int = 1
8✔
25
    val maxWidth: Int = 500
4✔
26

4✔
27
    val defaultHeight: Int = 10
28
    val minHeight: Int = 1
4✔
29
    val maxHeight: Int = 500
4✔
30

4✔
31
    val defaultEntities: Set[Entity] = Set.empty
32
    val maxEntities: Int = 200
10✔
33

5✔
34
  object StaticEntity:
UNCOV
35

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

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

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

5✔
58
  end StaticEntity
59

60
  object DynamicEntity:
61
    val zeroSpeed: Double = 0.0
3✔
62
    val minSpeed: Double = -1.0
8✔
63
    val maxSpeed: Double = 1.0
4✔
64
    val halfSpeed: Double = 0.5
4✔
65

5✔
66
    object Actuator:
UNCOV
67

×
68
      object DifferentialWheelMotor:
69
        val defaultWheel: ActWheel = ActWheel()
3✔
70

22✔
71
        object Wheel:
72
          val defaultSpeed: Double = 1.0
3✔
73
          val defaultShape: ShapeType.Circle = ShapeType.Circle(0.1)
8✔
74

7✔
75
    object Sensor:
UNCOV
76

×
77
      object ProximitySensor:
UNCOV
78
        val defaultOffset: Double = 0.0
×
79
        val defaultDistance: Double = 0.5
×
UNCOV
80
        val defaultRange: Double = 5.0
×
81

×
82
    object Robot:
83
      import SimulationDefaults.DynamicEntity.Robot.defaultShape.radius
3✔
84

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

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

3✔
103
      val stdLightSensors: Vector[Sensor[Robot, Environment]] = Vector(
104
        LightSensor(Orientation(0.0)),
6✔
105
        LightSensor(Orientation(45.0)),
20✔
106
        LightSensor(Orientation(90.0)),
12✔
107
        LightSensor(Orientation(135.0)),
12✔
108
        LightSensor(Orientation(180.0)),
12✔
109
        LightSensor(Orientation(225.0)),
12✔
110
        LightSensor(Orientation(270.0)),
12✔
111
        LightSensor(Orientation(315.0)),
12✔
112
      )
12✔
113
      val defaultPolicy: Policy = Policy.AlwaysForward
3✔
114
    end Robot
5✔
115
  end DynamicEntity
116

117
  object Fields:
UNCOV
118

×
119
    object Simulation:
120
      val self: String = "simulation"
3✔
121
      val duration: String = "duration"
8✔
122
      val seed: String = "seed"
4✔
123

5✔
124
    object Environment:
125
      val self: String = "environment"
3✔
126
      val width: String = "width"
8✔
127
      val height: String = "height"
4✔
128
      val entities: String = "entities"
4✔
129

5✔
130
    object Entity:
131
      val id: String = "id"
3✔
132
      val position: String = "position"
8✔
133
      val x: String = "x"
4✔
134
      val y: String = "y"
2✔
135
      val orientation: String = "orientation"
2✔
136

5✔
137
      object StaticEntity:
UNCOV
138

×
139
        object Obstacle:
140
          val self: String = "obstacle"
3✔
141
          val width: String = "width"
8✔
142
          val height: String = "height"
4✔
143

5✔
144
        object Light:
145
          val self: String = "light"
3✔
146
          val radius: String = "radius"
8✔
147
          val illuminationRadius: String = "illuminationRadius"
4✔
148
          val intensity: String = "intensity"
4✔
149
          val attenuation: String = "attenuation"
4✔
150

5✔
151
      object DynamicEntity:
UNCOV
152

×
153
        object Robot:
154
          val self: String = "robot"
3✔
155
          val radius: String = "radius"
8✔
156
          val speed: String = "speed"
4✔
157
          val withProximitySensors: String = "withProximitySensors"
4✔
158
          val withLightSensors: String = "withLightSensors"
4✔
159
          val behavior: String = "behavior"
4✔
160
    end Entity
5✔
161
  end Fields
162
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