Skip to content

Commit

Permalink
Trace effects on traced CellResources
Browse files Browse the repository at this point in the history
  • Loading branch information
David Legg committed Dec 8, 2023
1 parent 711a240 commit 47c7539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import gov.nasa.jpl.aerie.contrib.streamline.core.Expiring;
import gov.nasa.jpl.aerie.contrib.streamline.core.Resource;
import gov.nasa.jpl.aerie.merlin.framework.Condition;
import gov.nasa.jpl.aerie.merlin.protocol.types.Unit;

import java.util.Stack;
import java.util.function.Supplier;
Expand Down Expand Up @@ -47,7 +48,11 @@ public static <D extends Dynamics<?, D>> CellResource<D> trace(Supplier<String>

@Override
public void emit(final DynamicsEffect<D> effect) {
resource.emit(effect);
traceAction(
() -> String.format("Emit '%s' on %s",
Naming.getName(effect).orElse("anonymous effect"),
name.get()),
() -> { resource.emit(effect); return Unit.UNIT; });
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void solve() {
if (domainChanged) {
if (D.isEmpty()) {
throw new IllegalStateException(
"LinearArcConsistencySolver %s failed. Domain for %s is empty: [%s, %s]".formatted(
"LinearBoundaryConsistencySolver %s failed. Domain for %s is empty: [%s, %s]".formatted(
getName(this).orElseThrow(), D.variable, D.lowerBound, D.upperBound));
}
// TODO: Make this more efficient by not adding constraints that are already in the queue.
Expand Down

0 comments on commit 47c7539

Please sign in to comment.