Skip to content

Conversation

@taiseiKMC
Copy link
Contributor

@taiseiKMC taiseiKMC commented Dec 7, 2025

Update DataParametricMonitor to handle rational timestamp by simply replace some Parma_Polyhedra_Library::Coefficient with PPLRational (#5)

Used PPLRational similar to boolean parametric monitor.
Related to MasWag#5
For test of decimal integer data implemented the previous commit
(Related to MasWag#5)
@taiseiKMC taiseiKMC marked this pull request as ready for review December 7, 2025 18:50
Copy link
Owner

@MasWag MasWag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find that the intention of some of the comments are unclear. Can you clarify or fix them?


using TWEvent = TimedWordEvent<PPLRational>;

//DummyTimedWordSubject だと DummyTimedWordSubject2{std::move(vec)}.addObserver(monitor);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error is because DummyTimedWordSubject is already defined in test/boolean_monitor_test.cc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guessed as you said.
Renamed DummyTimedWordSubject2 to DummyDataTimedWordSubject

#include <boost/mpl/list.hpp>
#include "../src/data_parametric_monitor.hh"
#include "../test/fixture/copy_automaton_fixture.hh"
//TODO: copy_automaton_fixture の automaton は NonParametricTA だが、DataParametricTA にすべきな気がする
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixture of NonParametricTA is used in boolean_monitor_test.cc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(What was this line...?)
Just removed it.

* Remove memo
* DummyTimedWordSubject to DummyDataTimedWordSubject for clarity and consistency
@taiseiKMC
Copy link
Contributor Author

Oops. Sorry for forgetting to remove my memo

Copy link
Owner

@MasWag MasWag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the DataParametricMonitor to handle rational timestamps and data values by replacing Parma_Polyhedra_Library::Coefficient (integers) with PPLRational (rational numbers represented as numerator/denominator pairs).

Key changes:

  • Replaces Coefficient type with PPLRational in DataParametricMonitor and main.cc
  • Updates constraint handling to convert rational constraints to integer-based constraints using the formula var * denominator == numerator
  • Adds comprehensive test coverage for the updated DataParametricMonitor with rational number inputs

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/data_parametric_monitor.hh Updated type signatures from Coefficient to PPLRational and modified constraint addition to handle rational numbers by multiplying by denominator
src/main.cc Replaced Coefficient type alias with direct PPLRational usage in execute calls for dataparametric mode
test/data_parametric_monitor_test.cc Added new test file with test fixtures and two test cases to verify DataParametricMonitor behavior with rational number inputs
CMakeLists.txt Added the new test file to the build configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MasWag and others added 2 commits December 16, 2025 15:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MasWag MasWag merged commit c56d0ed into MasWag:master Dec 16, 2025
14 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants