I am trying to write a custom fitness function for the Discipulus genetic programming engine.
They give an example of an API DLL interface written in C.
I am trying to convert this to a PBWin DLL, however I do not have any experience with the C compiler or the Windows environment.
There are 6 different calls made from the API to the PB dll. I have only been able to get the first one working.
Can any one offer any suggestions to help get the rest to work?
Code:
unsigned int GetNrOfParameters() FUNCTION GPgetNumParms ALIAS "GetNrOfParameters" () EXPORT AS LONG 'This is the only one that is working float CalculateTrainingFitness(FUNCTION_PTR pGeneticProgram, long Length) FUNCTION GPcalcTF ALIAS "CalculateTrainingFitness" ( _ BYVAL aGP AS DWORD PTR,_ BYVAL Length AS LONG ) EXPORT AS SINGLE vvoid GetParameterInformation(unsigned int ParameterIndex, BSTR *ParameterName, BSTR *TypeInformation, BSTR *LowerBound, BSTR *UpperBound) SUB GPgetParmInfo ALIAS "GetParameterInformation" ( _ ParmIdx AS LONG, _ ParameterName AS ASCIIZ PTR, _ TypeInformation AS ASCIIZ PTR, _ LowerBound AS ASCIIZ PTR, _ Upperbound AS ASCIIZ PTR ) EXPORT void SetParameterValue(unsigned int ParameterIndex, LPCTSTR Value) SUB GPsetParmVal ALIAS "SetParameterValue" ( _ ParmIdx AS LONG, _ ParmVal AS ASCIIZ PTR ) EXPORT BSTR GetParameterValue(unsigned int ParameterIndex) FUNCTION GPgetParmVal ALIAS "GetParameterValue" ( _ ParmIdx AS LONG) EXPORT AS STRING void InitConstants(float *Constants, long NrOfConstants) SUB GPinitConst ALIAS "InitConstants" ( _ pConstants AS DWORD, _ NumOfConstants AS LONG ) EXPORT
Dennis
Comment