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

Reworking of the ObserverTimeEvolution #511

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JanNiklasB
Copy link

@JanNiklasB JanNiklasB commented Dec 19, 2024

Dear All,

in this pull request, I want to introduce a reworked ObserverTimeEvolution.
I replaced the addTimeRange function which filled the detList array with a function
that takes the required index as an argument and returns the time that should be observed.
For that, I also changed other parts of the ObserverTimeEvolution class to
correctly utilize that new getTime function.
I also kept the option of using a detList by utilizing a new constructor.
Furthermore, it is possible to use a user-defined getTime function by utilizing
the setUserDefinedGetTime function.

Additionally, I fixed the issue mentioned in #510.
For that, it was necessary to change some tests, since those handled
the maximum observed time like max = numb * dist when it should
be handled like max = min + numb * dist.

Copy link
Author

Choose a reason for hiding this comment

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

In this file I changed the Run_MomentumDiffusion function in cell 12:
maxD = N_obs * deltaD -> maxD = (N_obs + 1) * deltaD
since the minimum is set to D_min = deltaD

@@ -261,7 +262,7 @@ TEST(ObserverFeature, TimeEvolution) {

// detection two
c.setCurrentStep(0.1);
c.setTrajectoryLength(10.05);
c.setTrajectoryLength(15.05);
Copy link
Author

Choose a reason for hiding this comment

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

Here I changed the trajectory length of the candidate to a length larger then the last
detection threshold so a detection is expected.
10.05 is not enough, since 10 is not a detected length (see comment on line 239)

public:
// List containing all used times, is constructed in constructor or by user manually
// (leave empty if you want to rather use functions)
std::vector<double> detList;
Copy link
Author

Choose a reason for hiding this comment

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

detList is here defined public since it is necessary that the user has full control over it

std::vector<double> detList;

// Pointer to user defined version of getTime (should return time for corresponding index)
double (*customGetTime)(int index, double min, double max, int numb);
Copy link
Author

Choose a reason for hiding this comment

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

the same goes for the customGetTime pointer

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.

1 participant