MCPcopy Create free account
hub / github.com/chrxh/alien / writeNeuronProperty

Function writeNeuronProperty

source/EngineInterface/GenomeDescriptionService.cpp:51–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 writeFloat(data, (value - 150.0f) / 100);
50 }
51 void writeNeuronProperty(std::vector<uint8_t>& data, float value)
52 {
53 value = std::max(-3.9f, std::min(3.9f, value));
54 writeFloat(data, value / 4);
55 }
56 void writeDistance(std::vector<uint8_t>& data, float value)
57 {
58 data.emplace_back(static_cast<uint8_t>((value - 0.5f) * 255));

Callers 1

Calls 1

writeFloatFunction · 0.85

Tested by

no test coverage detected