Skip to content

MessagesFileNN.csv does not faithfully serialize the FSCell event buffer #139

Description

@ntua-el20123

Summary

MessagesFileNN.csv appears to be generated from the in-memory FSCell buffer using a row count that does not match the semantics of FSCell.

As a result, the output file is not guaranteed to contain either:

  • the complete set of recorded fire spread events, or
  • exactly one message per burned destination cell.

Instead, it currently writes an order-dependent prefix of the recorded event stream.


What FSCell contains

In CellsFBP::manageFire(...), every time the fire front from a burning cell reaches the center of a neighboring cell, one message event is appended to FSCell.

Each event consists of four values:

  • source cell ID
  • destination cell ID
  • fire period
  • realized ROS

Relevant code:

if (fireProgress[nb] >= distToCenter[nb]) {
    FSCell->push_back(realId);
    FSCell->push_back(nb);
    FSCell->push_back(period);
    FSCell->push_back(ros);
}

Therefore, FSCell is naturally an append-only event stream containing every recorded reach-to-center message generated during the simulation.


Where the mismatch occurs

At the end of the simulation, MessagesFileNN.csv is written using

CSVPloter.printCSVDouble_V2(
    this->burntCells.size() - this->nIgnitions,
    4,
    this->FSCell
);

However, printCSVDouble_V2(...) simply writes the first rows tuples from the supplied vector.

Thus the number of rows written is

burntCells.size() - nIgnitions

instead of

FSCell.size() / 4

which is the actual number of recorded events stored in FSCell.


FSCell may legitimately contain:

  • repeated (source, destination) message events across multiple fire periods,
  • multiple incoming message events for the same destination cell,
  • reach-to-center events for destinations that ultimately never satisfy get_burned(...).

Consequently, MessagesFileNN.csv is currently not guaranteed to represent either:

  1. the complete set of recorded message events, or
  2. one canonical message per burned non-ignition cell.

Instead, it becomes an order-dependent prefix of the event buffer.

Furthermore, because events are appended while iterating over containers such as burningCells and ROSAngleDir, the retained prefix does not appear to correspond to any explicit or documented selection rule.


Observed downstream impact

This affects all outputs that consume MessagesFileNN.csv, including:

  • PropagationTreeNN.png
  • FireSpreadTreeNN_*.png
  • aggregated spread graphs constructed from the message files

because these visualizations are built from a potentially truncated event stream.


Questions for the maintainers

  1. Was MessagesFileNN.csv intended to contain:

    • all recorded reach-to-center events, or
    • exactly one representative message per burned destination cell?
  2. If the latter is the intended behavior, what is the intended parent/message selection rule?

    • First arrival?
    • Earliest fire period?
    • Highest ROS?
    • Another criterion?

Without an explicit selection rule, the current implementation appears to produce an order-dependent subset of the recorded events rather than a well-defined propagation tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions