i have tried hard but dont know wy im getting this error , error comes in line 8
class CPop
{
CBSVector<CTour> pop;
CBSVector<double> probability;
int popsize;
double TotalFitness;
CTour Elite;
**CTspGAParams GAParameters;**
}
error C2059: syntax error : 'constant'
error C2238: unexpected token(s) preceding ';'
[POP]// Pop.h: interface for the CPop class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_POP_H__EB3D0F86_2CDB_4B6D_BCD2_D33ECC20E5BA__INCLUDED_)
#define AFX_POP_H__EB3D0F86_2CDB_4B6D_BCD2_D33ECC20E5BA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Tour.h"
#include "TspGAParams.h"
class CPop
{
CBSVector<CTour> pop;
CBSVector<double> probability;
int popsize;
double TotalFitness;
CTour Elite;
CTspGAParams GAParameters;
public:
CPop();
virtual ~CPop();
void seed();
void RandomInitialize(const CTspGAParams ¶m);
void initializePop(int citysze,int popsze);
bool isExist(int i,int citysze);
void computePopFitness(CBSMatrix<double>& matrix,int citysze);
void MaxMinFitness(int &minIndex,int &maxIndex);
void MaintainElite(int citysze);
void displaypop();
void computeTotalFitness();
void computeProbabilities();
int selectparent();
void performCrossover(int parent1,int parent2,int offspring1,int offspring2,int ncities,CBSVector<CTour> & newPop);
void SwapMutation(int index,int ncities,CBSVector<CTour> & newPop); //,int nExchanges)
void reproduction(int ncities);
};
#endif // !defined(AFX_POP_H__EB3D0F86_2CDB_4B6D_BCD2_D33ECC20E5BA__INCLUDED_)
[/POP]
[TspGAParams]// TspGAParams.h: interface for the CTspGAParams class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TSPGAPARAMS_H__CA596612_60BC_42A7_94CF_755448048E57__INCLUDED_)
#define AFX_TSPGAPARAMS_H__CA596612_60BC_42A7_94CF_755448048E57__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTspGAParams
{
int PopSize;
int n_Cities;
int MaxIeration;
double CrossOverRate;
double MutationRate;
//double LowerFitLimit;
//double UpperFitLimit;
public:
CTspGAParams();
virtual ~CTspGAParams();
void InitializeParam(int popsize, int ncities,int MaxIter, double XoverRate,double MutateRate);//,double UpLimit,double LowLimit)
int GetPopSize();
void SetPopSize(int popsize);
int GetCities();
void SetCities(int ncities);
int GetMaxIeration();
void SetMaxIeration(int MaxIter);
double GetCrossOverRate();
void SetCrossOverRate(double XoverRate);
double GetMutationRate();
void SetMutationRate(double MutateRate);
};
#endif // !defined(AFX_TSPGAPARAMS_H__CA596612_60BC_42A7_94CF_755448048E57__INCLUDED_)
[/TspGAParams]