< Summary

Class:LinearExtrapolator
Assembly:bamlab.micromissiles
File(s):/github/workspace/Assets/Scripts/Algorithms/Prediction/LinearExtrapolator.cs
Covered lines:0
Uncovered lines:5
Coverable lines:5
Total lines:14
Line coverage:0% (0 of 5)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:2
Method coverage:0% (0 of 2)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
LinearExtrapolator(...)0%2100%
Predict(...)0%2100%

File(s)

/github/workspace/Assets/Scripts/Algorithms/Prediction/LinearExtrapolator.cs

#LineLine coverage
 1using System.Linq;
 2using UnityEngine;
 3
 4// The linear extrapolator class predicts the trajectory of an agent by linearly extrapolating its
 5// current position and velocity.
 6public class LinearExtrapolator : IPredictor {
 07  public LinearExtrapolator(in Agent agent) : base(agent) {}
 8
 9  // Predict the state at the given time.
 010  public override PredictorState Predict(float time) {
 011    Vector3 position = _state.Position + _state.Velocity * time;
 012    return new PredictorState(position, _state.Velocity, _state.Acceleration);
 013  }
 14}