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

Method compareCellFunctionMutation

source/EngineTests/MutationTests.cpp:395–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393 }
394
395 bool compareCellFunctionMutation(std::vector<uint8_t> const& expected, std::vector<uint8_t> const& actual)
396 {
397 auto expectedGenome = GenomeDescriptionService::get().convertBytesToDescription(expected);
398 auto actualGenome = GenomeDescriptionService::get().convertBytesToDescription(actual);
399 if (expectedGenome.header != actualGenome.header) {
400 return false;
401 }
402 if (expectedGenome.cells.size() != actualGenome.cells.size()) {
403 return false;
404 }
405 for (auto const& [expectedCell, actualCell] : boost::combine(expectedGenome.cells, actualGenome.cells)) {
406 if (std::abs(expectedCell.referenceAngle - actualCell.referenceAngle) > NEAR_ZERO) {
407 return false;
408 }
409 if (std::abs(expectedCell.energy- actualCell.energy) > NEAR_ZERO) {
410 return false;
411 }
412 if (expectedCell.color != actualCell.color) {
413 return false;
414 }
415 if (expectedCell.numRequiredAdditionalConnections != actualCell.numRequiredAdditionalConnections) {
416 return false;
417 }
418 if (expectedCell.executionOrderNumber != actualCell.executionOrderNumber) {
419 return false;
420 }
421 if (expectedCell.inputExecutionOrderNumber != actualCell.inputExecutionOrderNumber) {
422 return false;
423 }
424 if (expectedCell.outputBlocked != actualCell.outputBlocked) {
425 return false;
426 }
427 }
428 return true;
429 }
430
431 bool compareInsertMutation(std::vector<uint8_t> const& before, std::vector<uint8_t> const& after)
432 {

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80

Tested by

no test coverage detected