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

Function writeEnergy

source/EngineInterface/GenomeDescriptionService.cpp:47–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 data.emplace_back(static_cast<uint8_t>(static_cast<int8_t>((value * 2 - 1) * 128)));
46 }
47 void writeEnergy(std::vector<uint8_t>& data, float value)
48 {
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));

Callers 1

Calls 1

writeFloatFunction · 0.85

Tested by

no test coverage detected