#include "VrptwAlgorithm.h"
#include "VrptwAlgorithmExtension.h"
#include "LogVRPData.h"
#include "GKFleetVehicle.h"
#include "GKClient.h"
#include "GKClientProperty.h"
#include <time.h>
#include <math.h>
void VrptwAlgorithm::setData( LogVRPData* data )
{
//allocating demand memory
DemandQ = (int*)calloc( DemandNo+1, sizeof(int) );
ServiceTime = (int*)calloc( DemandNo+1, sizeof(int) );
//setting up DemandQ values
QMap< uint, GKLogVertex* >::const_iterator iter, iterEnd;
iterEnd = data->getVertexs().end();
for( iter = data->getVertexs().begin(); iter != iterEnd; ++iter ){
//trying to convert a GKLogVertex into a GKClient
GKClient * client = dynamic_cast<GKClient*>( iter.value() );
if( client != NULL ){//the vertex is a client
DemandQ[iter.key()] = data->getClientProperty( client ).getDemand();
ServiceTime[iter.key()] = data->getClientProperty( client ).getServiceTime();
}
}