double GeneticAlgorithm::calcFitness(Individual* indiv)
// Calculate fitness based on number of ones in chromosome
{
Rama rama = new Rama[indiv->getChromosomeLength()]
for (int i=0; i<indiv->getChromosomeLength();i++)
{
rama[i]=indiv->getGene(i);
}
that throws an error message:
GeneticAlgorithm.cc:115:14: error: conversion from ‘Rama*’ to non-scalar type ‘Rama’ requested
Rama rama = new Rama[indiv->getChromosomeLength()]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GeneticAlgorithm.cc:116:16: error: ‘i’ was not declared in this scope
for (int i=0; i<indiv->getChromosomeLength();i++)