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

Implement composite lexicographic less operator for TPs, TAs, TCs #162

Open
alessandrothea opened this issue Oct 3, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@alessandrothea
Copy link
Contributor

At the moment less is based on simple timestamp comparison.
The effect is that TPs/TAs/TCs are not captured correctly by readout requests.
Appropriate less operators need to be implemented for TPWrapper, TAWrapper and TCWrapper classes in the respective T<X>Buffers declarations.

@alessandrothea alessandrothea self-assigned this Oct 3, 2022
@alessandrothea alessandrothea added the bug Something isn't working label Oct 13, 2022
@ArturSztuc
Copy link
Contributor

Not closing yet, but this is already completed for TPs and TAs, where the less operator is based on both the time, and the channel (channel_start in case of TA).

For TC this is based on the time_start and type. This is not ideal if we have two TCs at the same time, of the same type.
TCs do not require to have TAs, and therefore any locality information (e.g. timing events), so this might need more thinking before implementing.

I'm currently thinking of something along:

   bool operator<(const TCWrapper& other) const
      {
        if (this->candidate.inputs.size() && other->candidate.inputs.size()) {
          return std::tie(this->candidate.time_start, this->candidate.type, this->candidate.inputs.begin()->channel_start)
                  < std::tie(other.candidate.time_start, other.candidate.type, other.candidate.inputs.begin()->channel_start);
        }
        return std::tie(this->candidate.time_start, this->candidate.type) < std::tie(other.candidate.time_start, other.candidate.type);
      }

but it seems messy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants