TProcura
Biblioteca em C++ para testes paramétricos de algoritmos, e coleção de algoritmos de procura e otimização
Loading...
Searching...
No Matches
CListaNo Class Reference

Lista ordenada de nós para algoritmos de procura informada. More...

#include <CListaNo.h>

Collaboration diagram for CListaNo:

Public Member Functions

 CListaNo (int limite=0)
 Construtor da lista de nós.
 
 ~CListaNo ()
 
bool Completa ()
 Indica se a lista é completa (nunca foi limpa).
 
int Valor (int i)
 Retorna o valor (LowerBound) de um elemento.
 
int Proximo (int i=-1)
 Retorna o próximo elemento na lista.
 
int ProximoDistinto (int i=-1)
 Retorna o próximo elemento com custo distinto.
 
TNo Estado (int i=-1)
 Retorna o estado armazenado no elemento.
 
int Inserir (TNo elemento, int id=0)
 Insere um novo estado na lista, por ordem de LowerBound.
 
void Inserir (TVector< TNo > &elementos)
 Insere vários estados na lista, por ordem.
 

Public Attributes

int atual
 Índice do elemento atual a processar.
 

Detailed Description

Lista ordenada de nós para algoritmos de procura informada.

Utilizada nos algoritmos CustoUniforme e AStar para gerir estados ordenados por custo.

Definition at line 23 of file CListaNo.h.

Constructor & Destructor Documentation

◆ CListaNo()

CListaNo::CListaNo ( int  limite = 0)
inline

Construtor da lista de nós.

Parameters
limiteTamanho limite da lista (opcional).

Definition at line 34 of file CListaNo.h.

◆ ~CListaNo()

CListaNo::~CListaNo ( )

Definition at line 3 of file CListaNo.cpp.

Member Function Documentation

◆ Completa()

bool CListaNo::Completa ( )
inline

Indica se a lista é completa (nunca foi limpa).

Returns
true se nunca foi limpa; false caso contrário.

Definition at line 48 of file CListaNo.h.

◆ Estado()

TNo CListaNo::Estado ( int  i = -1)
inline

Retorna o estado armazenado no elemento.

Parameters
iÍndice do elemento (opcional).
Returns
Ponteiro para o estado ou NULL se inválido.

Definition at line 93 of file CListaNo.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Inserir() [1/2]

int CListaNo::Inserir ( TNo  elemento,
int  id = 0 
)

Insere um novo estado na lista, por ordem de LowerBound.

Parameters
elementoEstado a inserir.
idID associado (opcional).
Returns
Índice do primeiro elemento com o mesmo valor.

Definition at line 83 of file CListaNo.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Inserir() [2/2]

void CListaNo::Inserir ( TVector< TNo > &  elementos)

Insere vários estados na lista, por ordem.

Parameters
elementosVetor de estados a inserir.

Definition at line 136 of file CListaNo.cpp.

Here is the call graph for this function:

◆ Proximo()

int CListaNo::Proximo ( int  i = -1)
inline

Retorna o próximo elemento na lista.

Parameters
iÍndice de referência (opcional). Se não fornecido, usa o atual.
Returns
Índice do próximo elemento ou -1 se não existir.

Definition at line 67 of file CListaNo.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProximoDistinto()

int CListaNo::ProximoDistinto ( int  i = -1)
inline

Retorna o próximo elemento com custo distinto.

Parameters
iÍndice de referência (opcional).
Returns
Índice do próximo elemento distinto ou -1.

Definition at line 80 of file CListaNo.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Valor()

int CListaNo::Valor ( int  i)
inline

Retorna o valor (LowerBound) de um elemento.

Parameters
iÍndice do elemento.
Returns
Valor do elemento ou INT_MAX se inválido.

Definition at line 55 of file CListaNo.h.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ atual

int CListaNo::atual

Índice do elemento atual a processar.

Definition at line 42 of file CListaNo.h.


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