LearnTA
0.0.1
|
A timed word. More...
#include <timed_word.hh>
Public Member Functions | |
TimedWord (const std::string &word, const std::vector< double > &durations) | |
Constructor of timed words. More... | |
TimedWord | operator+ (const TimedWord &another) const |
Return the concatenation of two timed words. More... | |
TimedWord | operator+ (const char action) |
Return the concatenation of this timed word and an action. More... | |
TimedWord | operator+ (const double duration) |
Return the concatenation of this timed word and a time elapse. More... | |
std::ostream & | print (std::ostream &stream) const |
Print the timed word to the stream. More... | |
const std::string & | getWord () const |
const std::vector< double > & | getDurations () const |
std::vector< double > | getAccumulatedDurations () const |
Construct and return the (tail) accumulated duration. More... | |
TimedWord | getSuffix (const TimedWord &prefix) const |
std::size_t | wordSize () const |
Return the number of the actions in this timed word. | |
bool | operator== (const TimedWord &another) const |
A timed word.
We represent the timed word by a sequence of events and the time elapse between each of them (not timestamps), i.e., \(\tau_0 a_1 \tau_1 \dots \tau_{n-1} a_{n} \tau_{n} \).
|
inline |
Constructor of timed words.
|
inline |
Construct and return the (tail) accumulated duration.
The accumulated duration is a vector representing \(\mathbb{T}_{i,N}\), where \(N\) is the length.
@breif Return the suffix such that the concatenation with prefix is this
|
inline |
Return the concatenation of this timed word and an action.
Let this be \(\tau_0 a_1 \tau_1 \dots \tau_{n-1} a_{n} \tau_{n} \) and action be \(a\). The result is \(\tau_0 a_1 \tau_1 \dots \tau_{n-1} a_{n} \tau_{n} a 0 \).
|
inline |
Return the concatenation of this timed word and a time elapse.
Let this be \(\tau_0 a_1 \tau_1 \dots \tau_{n-1} a_{n} \tau_{n} \) and duration be \(t\). The result is \(\tau_0 a_1 \tau_1 \dots \tau_{n-1} a_{n} \tau_{n} + t\).
Return the concatenation of two timed words.
Let this be \(\tau_0 a_1 \tau_1 \dots \tau_{n-1} a_{n} \tau_{n} \) and another be \(\tau'_0 a'_1 \tau'_1 \dots \tau'_{m-1} a'_{m} \tau'_{m} \). The result is \(\tau_0 a_1 \tau_1 \dots \tau_{n-1} a_{n} \tau_{n} + \tau'_0 a'_1 \tau'_1 \dots \tau'_{m-1} a'_{m} \tau'_{m}\).
|
inline |
Print the timed word to the stream.
stream | The stream to write this timed word |