Skip to content

Commit

Permalink
Fix another mysterious federated execution bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh committed Oct 1, 2023
1 parent 881b4d6 commit 5194bf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,9 @@ private String generateCodeToInitializeFederate(FederateInstance federate, RtiCo
private String generateCodeForPhysicalActions(
FederateInstance federate, MessageReporter messageReporter) {
CodeBuilder code = new CodeBuilder();
if (federate.targetConfig.coordination.equals(CoordinationMode.CENTRALIZED)) {
var coordinationMode = federate.targetConfig.coordination.get();
var coordinationOptions = federate.targetConfig.coordinationOptions.get();
if (coordinationMode.equals(CoordinationMode.CENTRALIZED)) {
// If this program uses centralized coordination then check
// for outputs that depend on physical actions so that null messages can be
// sent to the RTI.
Expand All @@ -819,7 +821,7 @@ private String generateCodeForPhysicalActions(
}
if (minDelay != TimeValue.MAX_VALUE) {
// Unless silenced, issue a warning.
if (federate.targetConfig.coordinationOptions.get().advanceMessageInterval == null) {
if (coordinationOptions.advanceMessageInterval == null) {
String message =
String.join(
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public static void handleCompileDefinitions(
private static void handleAdvanceMessageInterval(FederateInstance federate) {
var advanceMessageInterval =
federate.targetConfig.coordinationOptions.get().advanceMessageInterval;
federate.targetConfig.coordinationOptions.reset();
if (advanceMessageInterval != null) {
federate.targetConfig.compileDefinitions.put(
"ADVANCE_MESSAGE_INTERVAL", String.valueOf(advanceMessageInterval.toNanoSeconds()));
Expand Down

0 comments on commit 5194bf1

Please sign in to comment.