Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of ActivityExpression and derived classes #1175

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ RootFindingResult<T, History> findRoot(Function<T, History> f,

public interface Function<T, History> {
T valueAt(T x, History historyType);
boolean isApproximation();
}

public static class ZeroDerivativeException extends Exception{
Expand Down Expand Up @@ -89,11 +88,6 @@ public RootFindingResult<Duration, History> findRoot(
public Duration valueAt(final Duration x, final History history) {
return f.valueAt(x, history).minus(y);
}

@Override
public boolean isApproximation() {
return f.isApproximation();
}
Mythicaeda marked this conversation as resolved.
Show resolved Hide resolved
};

double x_nminus1_double = x0.in(Duration.MICROSECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment;
import gov.nasa.jpl.aerie.constraints.time.Windows;
import gov.nasa.jpl.aerie.merlin.protocol.types.Duration;
import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityCreationTemplate;
import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression;
import gov.nasa.jpl.aerie.scheduler.goals.ActivityTemplateGoal;

import java.util.Optional;
Expand All @@ -28,7 +28,7 @@ public class MissingActivityTemplateConflict extends MissingActivityConflict {
public MissingActivityTemplateConflict(
ActivityTemplateGoal goal,
Windows temporalContext,
ActivityCreationTemplate template,
ActivityExpression template,
EvaluationEnvironment evaluationEnvironment,
int cardinality,
Optional<Duration> totalDuration)
Expand Down Expand Up @@ -95,9 +95,9 @@ public ActivityTemplateGoal getGoal() {
/**
* The conflict can constraint the goal template to guide the search
*/
private final ActivityCreationTemplate template;
private final ActivityExpression template;

public ActivityCreationTemplate getActTemplate() {
public ActivityExpression getActTemplate() {
return template;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public Windows computeRange(final SimulationResults simulationResults, final Pla
if(minTimepoint.isPresent() && maxTimepoint.isPresent()) {
final var anchorActSearch = new ActivityExpression.Builder()
.basedOn(actTemplate)
.startsIn(inter).build(); //check if it exists IN the windows, not just the upper and lower bounds of the interval
//.startsIn(inter)
adrienmaillard marked this conversation as resolved.
Show resolved Hide resolved
.build(); //check if it exists IN the windows, not just the upper and lower bounds of the interval
final var anchorActs = plan.find(anchorActSearch, simulationResults, new EvaluationEnvironment());
for (var anchorAct : anchorActs) {
var endInclusivity = Interval.Inclusivity.Exclusive;
Expand Down
Loading
Loading