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

Error fix on updating input port status #398

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
5 changes: 4 additions & 1 deletion core/federated/federate.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,17 @@ static void update_last_known_status_on_input_ports(tag_t tag) {
* @param portID The port ID.
*/
static void update_last_known_status_on_input_port(environment_t* env, tag_t tag, int port_id) {
#ifdef FEDERATED_DECENTRALIZED
if (lf_tag_compare(tag, env->current_tag) < 0)
tag = env->current_tag;
#endif // FEDERATED_DECENTRALIZED
trigger_t* input_port_action = action_for_port(port_id)->trigger;
int comparison = lf_tag_compare(tag, input_port_action->last_known_status_tag);
if (comparison == 0)
tag.microstep++;
if (comparison >= 0) {
LF_PRINT_LOG("Updating the last known status tag of port %d from " PRINTF_TAG " to " PRINTF_TAG ".", port_id,
LF_PRINT_LOG("At tag " PRINTF_TAG ", Updating the last known status tag of port %d from " PRINTF_TAG " to " PRINTF_TAG ".",
env->current_tag.time, env->current_tag.microstep, port_id,
input_port_action->last_known_status_tag.time - lf_time_start(),
input_port_action->last_known_status_tag.microstep, tag.time - lf_time_start(), tag.microstep);
input_port_action->last_known_status_tag = tag;
Expand Down
Loading