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

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

18 Aug 2025 12:42PM UTC coverage: 61.478% (-15.7%) from 77.166%
#310

push

github

srs-mate
refactor: update RobotActionLogic to use robot parameter directly and enable debug mode

1 of 4 new or added lines in 2 files covered. (25.0%)

309 existing lines in 26 files now uncovered.

932 of 1516 relevant lines covered (61.48%)

8.82 hits per line

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

91.43
/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.Rule
11
import io.github.srs.model.entity.dynamicentity.behavior.Rules
12
import io.github.srs.model.entity.dynamicentity.sensor.{ ProximitySensor, Sensor, SensorReadings }
13
import io.github.srs.model.environment.Environment
14

15
object SimulationDefaults:
16

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

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

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

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

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

5✔
36
  object StaticEntity:
UNCOV
37

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

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

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

5✔
60
  end StaticEntity
61

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

5✔
68
    object Actuator:
69

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

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

7✔
77
    object Sensor:
UNCOV
78

×
79
      object ProximitySensor:
80
        val defaultOffset: Double = 0.0
3✔
81
        val defaultDistance: Double = 0.5
8✔
82
        val defaultRange: Double = 5.0
4✔
83

5✔
84
    object Robot:
85
      import SimulationDefaults.DynamicEntity.Robot.defaultShape.radius
3✔
86

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

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

3✔
105
      // TODO: Add light sensors when implemented
106
      val stdLightSensors: Vector[Sensor[Robot, Environment]] = Vector.empty
107

10✔
108
      val defaultBehavior: Rule[IO, SensorReadings, Action[IO]] = Rules.alwaysForward[IO]
109
    end Robot
14✔
110
  end DynamicEntity
111
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