Skip to content

Commit

Permalink
Merge pull request #135 from lf-lang/schedule-properly
Browse files Browse the repository at this point in the history
Add the microstep only when the actions are scheduled at the current tag
  • Loading branch information
lhstrh authored Feb 25, 2023
2 parents 30cbc44 + c039537 commit be7b4f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions __tests__/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ReactorWithFederatePortAction extends App {
}

describe('Intended tag tests', function () {
it('Undefined inteded tag', function() {
it('Undefined intended tag', function() {
intendedTagDelay = undefined
let app = new ReactorWithFederatePortAction()
expect(() => app._start()).toThrowError("FederatedPortAction must have an intended tag from RTI.")
Expand All @@ -56,7 +56,7 @@ describe('Intended tag tests', function () {

it('Intended tag equal to current tag', function() {
intendedTagDelay = TimeValue.nsec(10)
intendedTagMicrostepDelay = 1
intendedTagMicrostepDelay = 0
let app = new ReactorWithFederatePortAction()
app.setLastTagProvisional(false)
expect(() => app._start()).toThrowError("Intended tag must be greater than current tag. Intended tag: ")
Expand Down
2 changes: 1 addition & 1 deletion src/core/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export abstract class SchedulableAction<T extends Present> implements Sched<T> {
Log.debug(this, () => "Using intended tag from RTI, similar to schedule_at_tag(tag) with an intended tag: " +
intendedTag);
tag = intendedTag;
} else {
} else if (delay.isEqualTo(TimeValue.zero())) {
tag = tag.getMicroStepsLater(1);
}

Expand Down

0 comments on commit be7b4f1

Please sign in to comment.