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

Method randomizeGenomeColors

source/EngineInterface/DescriptionEditService.cpp:446–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446void DescriptionEditService::randomizeGenomeColors(ClusteredDataDescription& data, std::vector<int> const& colorCodes)
447{
448 for (auto& cluster : data.clusters) {
449 auto newColor = colorCodes[NumberGenerator::get().getRandomInt(toInt(colorCodes.size()))];
450 for (auto& cell : cluster.cells) {
451 if (cell.hasGenome()) {
452 colorizeGenomeNodes(cell.getGenomeRef(), newColor);
453 }
454 }
455 }
456}
457
458void DescriptionEditService::randomizeEnergies(ClusteredDataDescription& data, float minEnergy, float maxEnergy)
459{

Callers 1

onExecuteMethod · 0.80

Calls 5

toIntFunction · 0.85
colorizeGenomeNodesFunction · 0.85
getRandomIntMethod · 0.80
sizeMethod · 0.80
hasGenomeMethod · 0.45

Tested by

no test coverage detected