GEGELATI
|
#include <line.h>
Public Member Functions | |
Line (const Environment &env) | |
Constructor for a Line of a program. More... | |
Line (const Line &other) | |
Copy constructor of a Line performing a deep copy. More... | |
Line & | operator= (const Line &other)=delete |
~Line () | |
const Environment & | getEnvironment () const |
Get the environment within which the Line was created. More... | |
uint64_t | getDestinationIndex () const |
Getter for the destinationIndex of this Line. More... | |
bool | setDestinationIndex (const uint64_t dest, const bool check=true) |
Setter for the destinationIndex of this Line. More... | |
uint64_t | getInstructionIndex () const |
Getter for the instructionIndex of this Line. More... | |
bool | setInstructionIndex (const uint64_t instr, const bool check=true) |
Setter for the instructionIndex of this Line. More... | |
const std::pair< uint64_t, uint64_t > & | getOperand (const uint64_t idx) const |
Getter for the operands of this Line. More... | |
bool | setOperand (const uint64_t idx, const uint64_t dataIndex, const uint64_t location, const bool check=true) |
Setter for the operands of this Line. More... | |
bool | operator== (const Line &other) const |
Comparison operator between Line. More... | |
bool | operator!= (const Line &other) const |
Opposite of the operator==. | |
Protected Member Functions | |
Line ()=delete | |
Delete the default constructor. | |
Protected Attributes | |
const Environment & | environment |
Environment within which the Program will be executed. | |
uint64_t | instructionIndex |
index of the Instruction of the Set of the Environment. | |
uint64_t | destinationIndex |
std::pair< uint64_t, uint64_t > *const | operands |
Class used to store information of a single line of a Program.
|
inline |
Constructor for a Line of a program.
Size of attributes will be determined by the given Environment.
[in] | env | the const reference to the Environment for this Program::Line. |
|
inline |
Copy constructor of a Line performing a deep copy.
Contrary to the default copy constructor, this one duplicates all pointer based attributes.
[in] | other | the const reference to the copied Program::Line. |
|
inline |
Destructor of a Program::Line.
Dealocates the memory allocated for attributes.
uint64_t Program::Line::getDestinationIndex | ( | ) | const |
Getter for the destinationIndex of this Line.
const Environment & Program::Line::getEnvironment | ( | ) | const |
Get the environment within which the Line was created.
Copyright or © or Copr. IETR/INSA - Rennes (2019 - 2020) :
Karol Desnos kdesn.nosp@m.os@i.nosp@m.nsa-r.nosp@m.enne.nosp@m.s.fr (2019 - 2020) Nicolas Sourbier nsour.nosp@m.bie@.nosp@m.insa-.nosp@m.renn.nosp@m.es.fr (2020)
GEGELATI is an open-source reinforcement learning framework for training artificial intelligence based on Tangled Program Graphs (TPGs).
This software is governed by the CeCILL-C license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-C license as circulated by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy, modify and redistribute granted by the license, users are provided only with a limited warranty and the software's author, the holder of the economic rights, and the successive licensors have only limited liability.
In this respect, the user's attention is drawn to the risks associated with loading, using, modifying and/or developing or reproducing the software by the user in light of its specific status of free software, that may mean that it is complicated to manipulate, and that also therefore means that it is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the software's suitability as regards their requirements in conditions enabling the security of their systems and/or data to be ensured and, more generally, to use and operate it in the same conditions as regards security.
The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms.
uint64_t Program::Line::getInstructionIndex | ( | ) | const |
Getter for the instructionIndex of this Line.
const std::pair< uint64_t, uint64_t > & Program::Line::getOperand | ( | const uint64_t | idx | ) | const |
bool Program::Line::operator== | ( | const Line & | other | ) | const |
Comparison operator between Line.
[in] | other | the line with which the current Line is compared. |
bool Program::Line::setDestinationIndex | ( | const uint64_t | dest, |
const bool | check = true |
||
) |
Setter for the destinationIndex of this Line.
Optionnaly, the validity of the given value can be checked with regards to the Environment of the Line. If the given value is not valid (i.e. it exceeds the number of available destinations) the attribute will not be overwritten.
[in] | dest | the new value for the destinationIndex attribute. |
[in] | check | whether the validity of the given new value. |
bool Program::Line::setInstructionIndex | ( | const uint64_t | instr, |
const bool | check = true |
||
) |
Setter for the instructionIndex of this Line.
Optionnaly, the validity of the given value can be checked with regards to the Environment of the Line. If the given value is not valid (i.e. it exceeds the number of available instructions) the attribute will not be overwritten.
[in] | instr | the new value for the instructionIndex attribute. |
[in] | check | whether the validity of the given new value. |
bool Program::Line::setOperand | ( | const uint64_t | idx, |
const uint64_t | dataIndex, | ||
const uint64_t | location, | ||
const bool | check = true |
||
) |
Setter for the operands of this Line.
Optionnaly, the validity of the given values can be checked with regards to the Environment of the Line. If the given dataIndex value is not valid (i.e. the dataHandler index exceeds the number of DataHandler of the Environment) the attribute will not be overwritten. The location may exceeds the largestAddressSpace of the indexed DataHandler, since it will be scaled by the programExecutionEngine when fetching the operands, however it. may not exceed the largestAddressSpace of the environment to make it possible to store it with the right number of bits.
[in] | idx | the index of the Operand to write. |
[in] | dataIndex | index of a DataHandler. |
[in] | location | the location of the operand value within the DataHandler. |
[in] | check | whether the validity of the given new value. |
std::range_error | if the given index exceeds the number of Operands of the Line. |
|
protected |
index of the register to which the result of this line should be written.
|
protected |
Array storing the operands pair (each with an index for the DataHandlers of the Environment, and a location within it.)