// File routCompute.h
#pragma overce
#include "geneset.h"
Class RoutCompute
{
PUBLIC:
RoutCompute (Void);
~ RoutCompute (Void);
// Routing calculation
Void ComputeMethods (int ** NetArray, int ** Valarray,
INT ** & results, int ROUTNUM, INDEX);
Private:
// Mature Gene Collection
GENESET * PGENESET;
// Route contact set
Nodeset routnodes;
// Route contact number
INT NODENUM;
// Network topology information and dissipation information
Int ** netArray;
Int ** valarray;
Private:
void init (int ** _netArray, int ** _valarray, int _routnum);
Void Evolution (RoutGene & Gene);
Bool Complete (Routgene & Ge);
Bool Decomplete (Routgene & Gene);
Void Builder1 (ROUTGENE & Me);
Void Builder2 (ROUTGENE & me);
Void Builder (ROUTGENE & Ge);
}
// File routCompute.cpp
#include "routCompute.h"
#include "resource.h"
#using
Using Namespace GeneResource;
RoutCompute :: RoutCompute (Void)
{
pgeneset = null;
NetArray = NULL;
Valarray = NULL;
Nodenum = 0;
SRAND ();
}
RoutCompute :: ~ RoutCompute (void)
{
IF (NetArray! = NULL)
delete [] NetArray;
IF (Valarray! = NULL)
DELETE [] Valarray;
IF (pgeneset! = null)
Delete pgeneset;
}
Void routcompute :: init (int ** _netArray, int ** _valarray, int _routnum)
{//initialization
Nodenum = _ROUTNUM;
Routnodes.setnodenum (nodenum);
For (int i = 0; i * (routnodes.getpnodeset () i) = i; NetArray = new int * [nodenum]; Valarray = new int * [nodenum]; For (int i = 0; i { NetArray [i] = new int [nodenum]; Valarray [i] = new int [nodenum]; For (int J = 0; j { NetArray [i] [j] = _netArray [i] [j]; Valarray [i] [j] = _VAlarray [i] [j]; } } // Pgeneset = New GeneSet (Nodenum, NetArray, Valarray); }