why he put this symble ( p-> ) before each variable?
what is it means
p->fx[0] = (-p->x[0]*p->x[0]+p->x[1]); //-x1*x1+x2
/*function 2*/
p->fx[1] = (p->x[0]/(double)2.0 + p->x[1] + 1);
for (i=0; i<NumFun; i++)
if (MINMAX[i]==0) //minimiza
p->fx[i]=-1*p->fx[i];
evaluaciones++;
}
/*Put here the contraints*/
void restricciones(individuo *p)
{
p->factible=1;
//first constraint
p->g[0] = p->x[0]/(double)6.0 + p->x[1] - 13.0/(double)2.0;
if (p->g[0] > 0)
p->factible = 0;
//second constraint
p->g[1] = p->x[0]/(double)2.0 + p->x[1] - 15.0/(double)2.0;
if (p->g[1] > 0)
p->factible=0;
//third constraint
p->g[2] = 5*p->x[0] + p->x[1] - 30;
if (p->g[2] > 0)
p->factible=0;
}
void pobInicial()
{int j,i;
individuo *nuevo, *p;
for(j=0; j<POB; j++){
nuevo = (individuo *) malloc(sizeof(individuo));
llenaDatos(nuevo); //llenar alos individuos
nuevo->next = NULL;
if(j==0)
inicio=nuevo;
else
p->next=nuevo;
p=nuevo;
}
}
void llenaDatos(individuo *p)
{ int i,j;
for(i=0; i< longitud; i++){
if(flip(0.5))
p->cromo[i]=0;
else
p->cromo[i]=1;
}
}