#include <ConscienceEncoder.h>
◆ decodeMovement()
| CscMovement * conscience_core::bridging::ConscienceEncoder::decodeMovement |
( |
const double *const |
values, |
|
|
int & |
arrayIndex |
|
) |
| const |
◆ decodeSequence()
| CscSequence * conscience_core::bridging::ConscienceEncoder::decodeSequence |
( |
const double *const |
values | ) |
const |
Decodes a sequence from an array of double values.
The function expects the values array to contain specific data that maps to the sequence's details such as encoder version, type, and states. The function validates the encoder version and proceeds to decode the sequence states.
- Parameters
-
| values | Pointer to the double array containing the sequence data. |
- Returns
- A pointer to a CscSequence object representing the decoded sequence.
- Note
- The function assumes that the encoder version of the data matches ENCODER_VERSION.
◆ decodeSequenceFromString()
| CscSequence * conscience_core::bridging::ConscienceEncoder::decodeSequenceFromString |
( |
const string & |
sequenceString | ) |
const |
Decodes a sequence from a string representation.
Given a string containing the sequence data separated by commas, this function tokenizes the string and decodes the tokens into a CscSequence object.
- Parameters
-
| sequenceString | The string containing the sequence information. |
- Returns
- A pointer to a CscSequence object representing the decoded sequence.
◆ decodeSequenceStates()
| CscSequence * conscience_core::bridging::ConscienceEncoder::decodeSequenceStates |
( |
const double *const |
values | ) |
const |
Decodes the states for a sequence from an array of double values.
This function is used internally by decodeSequence to extract the states from the double values. Each state may contain additional extras such as delay and duration.
- Parameters
-
| values | Pointer to the double array containing the state information of the sequence. |
- Returns
- A pointer to a CscSequence object containing the decoded states.
◆ decodeState()
| CscStateWithExtras conscience_core::bridging::ConscienceEncoder::decodeState |
( |
const double *const |
values | ) |
const |
|
virtual |
Decodes a Conscience state from raw values with given options. Warning, options must be the same between encode et decode
◆ decodeStateFromString()
| CscStateWithExtras conscience_core::bridging::ConscienceEncoder::decodeStateFromString |
( |
const string & |
valuesString, |
|
|
const string & |
delimiter = "," |
|
) |
| const |
|
virtual |
◆ encodeSequence()
Encodes given sequence. Internally uses encodeState if necessary (if sequence contains states)
- Note
- Encoded double list format (with number of values) : + 1 -> version + 3 -> nb vals / sequenceType / objectiveValue + 1 -> countStates then for each state : + 1 -> version + 1 -> options + 1 + 2 * countPivots -> count + key value per pivot + 1 + 2 * countPropellers -> count + key value per propeller + 1 + 2 * countWheels -> count + key value per wheel + 1 + 2 * countTranslations -> count + key value per translation
◆ encodeSequenceToString()
| string conscience_core::bridging::ConscienceEncoder::encodeSequenceToString |
( |
CscSequence * |
sequence | ) |
const |
|
virtual |
Encodes given sequence to a string representation
- See also
- ConscienceEncoder::encodeSequence(sequence)
◆ encodeState()
Returns encoded representation of given state double array of length: ConscienceEncoder::getEncodedStateLength(state, options)
- Parameters
-
| options | determine additional data to include/exclude from encoded state - by default CscStateEncodingOptions::NONE is selected |
◆ encodeStateToString()
◆ getEncodedStateLength()
◆ getInstance()
◆ ENCODER_VERSION
| constexpr double conscience_core::bridging::ConscienceEncoder::ENCODER_VERSION = 4.2 |
|
staticconstexpr |
The documentation for this class was generated from the following files: