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

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

22 Aug 2025 03:44PM UTC coverage: 57.73% (+0.6%) from 57.15%
#350

push

github

srs-mate
refactor: update robot action logic to use default max retries and binary search duration threshold

1 of 3 new or added lines in 2 files covered. (33.33%)

85 existing lines in 10 files now uncovered.

1109 of 1921 relevant lines covered (57.73%)

8.09 hits per line

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

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

3
import java.util.UUID
4

5
import scala.concurrent.duration.DurationInt
6

7
import io.github.srs.model.entity.*
8
import io.github.srs.model.entity.dynamicentity.Robot
9
import io.github.srs.model.entity.dynamicentity.actuator.{ Actuator, Wheel as ActWheel }
10
import io.github.srs.model.entity.dynamicentity.sensor.{ ProximitySensor, Sensor }
11
import io.github.srs.model.environment.Environment
12
import io.github.srs.model.entity.dynamicentity.sensor.LightSensor
13
import io.github.srs.model.entity.dynamicentity.behavior.Policy
14

15
object SimulationDefaults:
16

×
17
  val duration: Option[Long] = None
18
  val seed: Option[Long] = None
8✔
19
  val debugMode = true
4✔
20
  val binarySearchDurationThreshold = 1.microseconds
2✔
21

13✔
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 defaultMaxRetries = 10
89

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

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

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

122
  object Fields:
UNCOV
123

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

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

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

5✔
142
      object StaticEntity:
UNCOV
143

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

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

5✔
156
      object DynamicEntity:
UNCOV
157

×
158
        object Robot:
159
          val self: String = "robot"
3✔
160
          val radius: String = "radius"
8✔
161
          val speed: String = "speed"
4✔
162
          val withProximitySensors: String = "withProximitySensors"
4✔
163
          val withLightSensors: String = "withLightSensors"
4✔
164
          val behavior: String = "behavior"
4✔
165
    end Entity
5✔
166
  end Fields
167
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