< Summary

Class:IController
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Controller/Controller.cs
Covered lines:11
Uncovered lines:3
Coverable lines:14
Total lines:30
Line coverage:78.5% (11 of 14)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:4
Method coverage:75% (3 of 4)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
IController(...)0%110100%
Plan()0%110100%
PlanToWaypoint(...)0%110100%
PlanImpl(...)0%2100%

File(s)

/github/workspace/Assets/Scripts/Controller/Controller.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4// The controller class is an interface between the agent and its control law.
 5public class IController {
 6  // Agent that the controller is controlling.
 7  protected Agent _agent;
 8
 8149  public IController(Agent agent) {
 40710    _agent = agent;
 40711  }
 12
 13  // Plan the next optimal control to intercept the target.
 5014  public Vector3 Plan() {
 5015    Transformation relativeTransformation =
 16        _agent.GetRelativeTransformation(_agent.GetTargetModel());
 5017    return PlanImpl(relativeTransformation);
 5018  }
 19
 20  // Plan the next optimal control to the waypoint.
 35721  public Vector3 PlanToWaypoint(Vector3 waypoint) {
 35722    Transformation relativeTransformation = _agent.GetRelativeTransformationToWaypoint(waypoint);
 35723    return PlanImpl(relativeTransformation);
 35724  }
 25
 26  // Controller-dependent implementation of the control law.
 027  protected virtual Vector3 PlanImpl(in Transformation relativeTransformation) {
 028    return Vector3.zero;
 029  }
 30}