Skip to content

Commit

Permalink
Merge pull request #1550 from NASA-AMMOS/bugfix/clock-as-linear
Browse files Browse the repository at this point in the history
Bug fix for clock "asLinear"
  • Loading branch information
mattdailis authored Sep 9, 2024
2 parents 647c66d + 39d8696 commit a14b1ec
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static gov.nasa.jpl.aerie.contrib.streamline.modeling.discrete.DiscreteResources.not;
import static gov.nasa.jpl.aerie.contrib.streamline.modeling.linear.Linear.linear;
import static gov.nasa.jpl.aerie.merlin.protocol.types.Duration.EPSILON;
import static gov.nasa.jpl.aerie.merlin.protocol.types.Duration.SECOND;

public final class VariableClockResources {
private VariableClockResources() {}
Expand Down Expand Up @@ -51,7 +52,7 @@ public static Resource<Discrete<Boolean>> greaterThanOrEquals(Resource<VariableC
}

public static Resource<Linear> asLinear(Resource<VariableClock> clock, Duration unit) {
return map(clock, c -> linear(c.extract().ratioOver(unit), c.multiplier()));
return map(clock, c -> linear(c.extract().ratioOver(unit), c.multiplier() * SECOND.ratioOver(unit)));
}

public static Resource<VariableClock> asVariableClock(Resource<Clock> clock) {
Expand Down

0 comments on commit a14b1ec

Please sign in to comment.