@Salem:
I trimmed the source so thet I don't call any function that frees any memory before trying to call SimAnAlgorithm_run() & it didn't solve the problem.
@dmh2000:
SimAnAlgorithm.c has this as first line:
Code:
#include "SimAnAlgorithm.h"
SimAnAlgorithm.h contents:
Code:
#ifndef SIMANALGORITHM_DEFINED
#define SIMANALGORITHM_DEFINED
#include "AlgorithmHandler.h"
struct AlgorithmHandler_Critter * SimAnAlgorithm_run(
struct AlgorithmHandler_Settings * settings,
int maxRuns,
float fittnessLimit,
int restartPropability);
struct AlgorithmHandler_Critter * SimAnAlgorithm_genNeighbour(
struct AlgorithmHandler_Settings * settings,
struct AlgorithmHandler_Critter * parent);
int SimAnAlgorithm_getTransitionPropability(float eC,
float eBuur,
float temp);
float SimAnAlgorithm_getTemp( float progress);
float SimAnAlgorithm_getE( float fittness);
#endif
how are you determining the arguments have random values? with the debugger or printf's?
I use the debugger.
@rags_to_riches:
I compile with the build in VS 2010 compiler
EDIT:
I've been trying to compile with gcc -std=c99 -lm. Seems like VS 2010 was missing some bugs. After working out most obvious ones, I'm left with this:
Code:
main.o: In function `runProgram':
main.c:(.text+0x225): undefined reference to `SimAnAlgorithm_run'
collect2: ld returned 1 exit status
make: *** [test] Error 1
I guess something must be amiss with my function definition. I've been trying to find out what, but no success so far.
EDIT 2:
I've uploaded the updated project source:
Code:
http://www.opaalkust.com/Download/project%20AD3.rar