... | ... | @@ -7,13 +7,44 @@ GenIe can be used standalone or programmatically as a java library. For both pos |
|
|
|
|
|
## Standalone use
|
|
|
|
|
|
For using GenIe standalone, you have to specify an exec call for the fitness function. This executable will be called for each candidate vector evaluation, receiving the candidate vector values as invocation arguments. The last invocation argument will be the parents metadata as Json string.
|
|
|
For using GenIe standalone, you can specify an exec call for the fitness function. This executable will be called for each candidate vector evaluation, receiving the candidate vector values as invocation arguments (just strings from the configured value range), or over stdIn if enabled. The forelast invocation argument will be the parents metadata (json), the last argument the metadata from the top N candidate vectors of the parent population, also as Json string, simply as returned from the parents fitness function invocation.
|
|
|
|
|
|
GenIe will wait for the process to terminate, looking for a calculation result in its output. This calculation result must follow this example Json structure, and should be somewhere at the end of the process output:
|
|
|
Following an example of a stdInd json structure a fitness function call will receive:
|
|
|
```json
|
|
|
{
|
|
|
"candidateVectorParamNames": [ "summandA", "summandB", "summandC", "summandD" ],
|
|
|
"candidateVector": [ "3", "10", "10", "0" ],
|
|
|
"parentsMetadata": [
|
|
|
{
|
|
|
"shellVarNameExample": "shellVarValueExample",
|
|
|
"givenVector": "5,25,10,0"
|
|
|
},
|
|
|
{
|
|
|
"shellVarNameExample": "shellVarValueExample",
|
|
|
"givenVector": "3,10,10,0"
|
|
|
}
|
|
|
],
|
|
|
"eliteMetadata": [
|
|
|
{
|
|
|
"shellVarNameExample": "shellVarValueExample",
|
|
|
"givenVector": "3,10,10,0"
|
|
|
},
|
|
|
{
|
|
|
"shellVarNameExample": "shellVarValueExample",
|
|
|
"givenVector": "3,10,10,0"
|
|
|
},
|
|
|
{
|
|
|
"shellVarNameExample": "shellVarValueExample",
|
|
|
"givenVector": "3,10,10,0"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
```
|
|
|
|
|
|
GenIe will wait for the process to terminate, looking for a calculation result in its output (stdOut). This calculation result have to be like the following example Json structure, and should be somewhere at the end of the processes output. GenIe has a look to the tail of the output only, for performance purposes. Configure the tail length in the [config file](https://git.opendfki.de/reuschling/genie/-/blob/main/geneticOptimization.conf).
|
|
|
```json
|
|
|
{
|
|
|
"fitness":0.0,
|
|
|
"fitness":0.9,
|
|
|
"metadata":{
|
|
|
"someMetadataKey1":"someMetadataValue",
|
|
|
"someMetadataKeyN":"someMetadataValue"
|
... | ... | |