25#ifndef SAMPLE_FROMFILE_H
26#define SAMPLE_FROMFILE_H
53 explicit FromFile(
const std::string& filename,
const std::string& dvarName, std::size_t modulo);
92 double getNext(
unsigned int id);
std::shared_ptr< CmdArguments > CmdArguments_t
void allocate(const CmdArguments_t &args, const Comm::Bundle_t &comm) override
Parses and loads the data from the file into memory.
FromFile(const FromFile &)=delete
std::size_t mod_m
Modulo used to wrap indices.
~FromFile() override=default
Destructor.
std::size_t globalSize_m
Number of lines in the file (including header).
unsigned int getSize() const
Get the number of lines in the file (including the header).
std::vector< double > chain_m
The values for the selected design variable loaded from the file.
std::string dvarName_m
Name of the design variable to extract.
void create(std::shared_ptr< SampleIndividual > &ind, std::size_t i) override
Assign a sampled value to an individual's gene.
FromFile(FromFile &&) noexcept=default
FromFile & operator=(const FromFile &)=delete
std::string filename_m
File name where samples are read from.
double getNext(unsigned int id)
Returns the next value for the given individual ID.
FromFile(const std::string &filename, const std::string &dvarName, std::size_t modulo)