AutoPas  3.0.0
Loading...
Searching...
No Matches
Functions
autopas::tuningLogEntry Namespace Reference

Contains some helpers to write and read the tuning log entries. More...

Functions

std::string writeEvidence (long time, size_t iteration, const Configuration &config)
 Writes evidence to a string.
 
std::tuple< long, size_t, ConfigurationreadEvidence (std::stringstream &str)
 Reads the arguments of an evidence entry in the log file from a stringstream.
 
std::string writeTune ()
 Writes a tune entry for the log file into a string.
 
bool readTune (std::stringstream &str)
 Reads the arguments of a tune entry from the stringstream.
 
std::string writeReset (size_t iteration)
 Writes a reset entry in the log file to a string.
 
std::string writeLiveInfo (const LiveInfo &liveInfo)
 Writes a liveInfo entry in the log file to a string.
 
autopas::LiveInfo readLiveInfo (std::stringstream &str)
 Reads the arguments of a live info entry in the log file from a stringstream.
 
template<class T >
void toStringHelper (std::ostream &in, const T &val)
 Writes the given argument into the given ostream with following white space.
 
template<class... Payload>
auto toString (const Payload &...payload)
 Writes multiple arguments into a string using their << operator.
 
template<class... Payload>
std::tuple< Payload... > fromString (std::stringstream &stream)
 Reads multiple values from a stringstream using their >> operator.
 
size_t readReset (std::stringstream &str)
 Reads the arguments of a reset entry in the log file from a string.
 

Detailed Description

Contains some helpers to write and read the tuning log entries.

This namespace defines functions to both read and write tuning log entries.

They are declared and documented in src/autopas/tuning/tuningStrategy/TuningLogEntry.h. TODO(tobias): Move definition there.

Function Documentation

◆ fromString()

template<class... Payload>
std::tuple< Payload... > autopas::tuningLogEntry::fromString ( std::stringstream &  stream)

Reads multiple values from a stringstream using their >> operator.

Template Parameters
PayloadThe types of the valuaes to read.
Parameters
streamThe stringstream to read from.
Returns
The read values as a tuple.

◆ readEvidence()

std::tuple< long, size_t, Configuration > autopas::tuningLogEntry::readEvidence ( std::stringstream &  str)

Reads the arguments of an evidence entry in the log file from a stringstream.

Parameters
strThe stream to read from.
Returns
The evidence as a tuple.

◆ readLiveInfo()

LiveInfo autopas::tuningLogEntry::readLiveInfo ( std::stringstream &  str)

Reads the arguments of a live info entry in the log file from a stringstream.

Parameters
strThe stringstream to read from.
Returns
The LiveInfo read from the stream.

◆ readReset()

size_t autopas::tuningLogEntry::readReset ( std::stringstream &  str)

Reads the arguments of a reset entry in the log file from a string.

Parameters
strThe stringstream to read from.
Returns
The iteration the reset happened in.

◆ readTune()

bool autopas::tuningLogEntry::readTune ( std::stringstream &  str)

Reads the arguments of a tune entry from the stringstream.

Parameters
strThe stringstream.
Returns
The currentInvalid bool.

◆ toString()

template<class... Payload>
auto autopas::tuningLogEntry::toString ( const Payload &...  payload)

Writes multiple arguments into a string using their << operator.

Template Parameters
PayloadThe types of the arguments.
Parameters
payloadThe arguments to write.
Returns
The string representation of the arguments, with whitespaces between.

◆ toStringHelper()

template<class T >
void autopas::tuningLogEntry::toStringHelper ( std::ostream &  in,
const T &  val 
)

Writes the given argument into the given ostream with following white space.

Template Parameters
Ttype of the argument.
Parameters
inThe ostream.
valThe argument to write.

◆ writeEvidence()

std::string autopas::tuningLogEntry::writeEvidence ( long  time,
size_t  iteration,
const autopas::Configuration config 
)

Writes evidence to a string.

Parameters
timeThe measured time.
iterationThe iteration in was measured in.
configThe configuation used.
Returns
The string with the evidence.

◆ writeLiveInfo()

std::string autopas::tuningLogEntry::writeLiveInfo ( const autopas::LiveInfo liveInfo)

Writes a liveInfo entry in the log file to a string.

Parameters
liveInfoThe live info to write.
Returns
The string with the live info.

◆ writeReset()

std::string autopas::tuningLogEntry::writeReset ( size_t  iteration)

Writes a reset entry in the log file to a string.

Parameters
iterationThe iteration it was performed on.
Returns
The string with the reset entry.

◆ writeTune()

std::string autopas::tuningLogEntry::writeTune ( )

Writes a tune entry for the log file into a string.

Returns
The string with the tune entry.