GEGELATI

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Program::Line Class Reference

`#include <line.h>`

## Public Member Functions
| Line (const Environment &env)
| Constructor for a Line of a program.
| Line (const Line &other)
| Copy constructor of a Line performing a deep copy.
Line & | operator= (const Line &other)=delete
| ~Line ()
const Environment & | getEnvironment () const
| Get the environment within which the Line was created.
uint64_t | getDestinationIndex () const
| Getter for the destinationIndex of this Line.
bool | setDestinationIndex (const uint64_t dest, const bool check=true)
| Setter for the destinationIndex of this Line.
uint64_t | getInstructionIndex () const
| Getter for the instructionIndex of this Line.
bool | setInstructionIndex (const uint64_t instr, const bool check=true)
| Setter for the instructionIndex of this Line.
const std::pair< uint64_t, uint64_t > & | getOperand (const uint64_t idx) const
| Getter for the operands of this Line.
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.
bool | operator== (const Line &other) const
| Comparison operator between Line.
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

## Detailed Description

Class used to store information of a single line of a Program.

## Constructor & Destructor Documentation

## ◆ Line() [1/2]

Program::Line::Line | ( | const Environment & | env | ) |
| inline

Constructor for a Line of a program.

Size of attributes will be determined by the given Environment.

Parameters

  [in] | env | the const reference to the Environment for this Program::Line.

## ◆ Line() [2/2]

Program::Line::Line | ( | const Line & | other | ) |
| inline

Copy constructor of a Line performing a deep copy.

Contrary to the default copy constructor, this one duplicates all pointer based attributes.

Parameters

  [in] | other | the const reference to the copied Program::Line.

## ◆ ~Line()

Program::Line::~Line | ( |  | ) |
| inline

Destructor of a Program::Line.

Dealocates the memory allocated for attributes.

## Member Function Documentation

## ◆ getDestinationIndex()

uint64_t Program::Line::getDestinationIndex | ( |  | ) | const

Getter for the destinationIndex of this Line.

Returns
  the value of the destinationIndex attribute.

## ◆ getEnvironment()

const Environment & Program::Line::getEnvironment | ( |  | ) | const

Get the environment within which the Line was created.

Returns
  a const reference to the Environment of the Line.

Copyright or © or Copr. IETR/INSA - Rennes (2019 - 2025) :

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) Quentin Vacher qvach.nosp@m.er@i.nosp@m.nsa-r.nosp@m.enne.nosp@m.s.fr (2025)

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.

## ◆ getInstructionIndex()

uint64_t Program::Line::getInstructionIndex | ( |  | ) | const

Getter for the instructionIndex of this Line.

Returns
  the value of the instructionIndex attribute.

## ◆ getOperand()

const std::pair< uint64_t, uint64_t > & Program::Line::getOperand | ( | const uint64_t | idx | ) | const

Getter for the operands of this Line.

Parameters

  [in] | idx | the index of the accessed operand.

Returns
  the value of the operand pair at the given index.

Exceptions

  std::range_error | if the given index exceeds the number of Operands of the Line.

## ◆ operator=()

Line & Program::Line::operator= | ( | const Line & | other | ) |
| delete

Disable Line default assignment operator.

Until we see the need for it, there si no reason to enable assignment operator of Line

## ◆ operator==()

bool Program::Line::operator== | ( | const Line & | other | ) | const

Comparison operator between Line.

Parameters

  [in] | other | the line with which the current Line is compared.

Returns
  true if all attributes (except the Environment) of the two Lines are identical.

## ◆ setDestinationIndex()

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.

Parameters

  [in] | dest | the new value for the destinationIndex attribute.
  [in] | check | whether the validity of the given new value.

Returns
  true if checks are not activated, otherwise, return whether the value was valid and thus the writing was performed or not.

## ◆ setInstructionIndex()

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.

Parameters

  [in] | instr | the new value for the instructionIndex attribute.
  [in] | check | whether the validity of the given new value.

Returns
  true if checks are not activated, otherwise, return whether the value was valid and thus the writing was performed or not.

## ◆ setOperand()

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.

Parameters

  [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.

Returns
  true if checks are not activated, otherwise, return whether the value was valid and thus the writing was performed or not.

Exceptions

  std::range_error | if the given index exceeds the number of Operands of the Line.

## Member Data Documentation

## ◆ destinationIndex

uint64_t Program::Line::destinationIndex
| protected

index of the register to which the result of this line should be written.

## ◆ operands

std::pair<uint64_t, uint64_t>* const Program::Line::operands
| protected

Array storing the operands pair (each with an index for the DataHandlers of the Environment, and a location within it.)

The documentation for this class was generated from the following files:

- D:/a/gegelati/gegelati/gegelatilib/include/program/line.h
- D:/a/gegelati/gegelati/gegelatilib/src/program/line.cpp