public PCGNeatNodeData(PCGNeatNodeData previousNode, double normTreeDepth, double normTreeTotalSibNum, int setting) { parentNode = previousNode; normDepth = normTreeDepth; normSiblingIndex = normTreeTotalSibNum; contentSetting = setting; }
public void TestSharpHighLevelFeatures() { IGenomeDecoder <NeatGenome, IBlackBox> decoder = experiment.CreateGenomeDecoder(); IBlackBox box = decoder.Decode(contentEA.CurrentChampGenome); PCGSharpHighLevelFeatures featureCounts = new PCGSharpHighLevelFeatures(); for (int i = 0; i < ((PCGNeatExperiment)experiment).geomNodeList.Count; i++) { // Get cppn output for each node PCGNeatNodeData currentNode = ((PCGNeatExperiment)experiment).geomNodeList[i]; box.InputSignalArray[0] = currentNode.normDepth; box.InputSignalArray[1] = currentNode.normSiblingIndex; box.ResetState(); box.Activate(); double[] outputs = new double[box.OutputCount]; for (int j = 0; j < box.OutputCount; j++) { outputs[j] = box.OutputSignalArray[j]; } // Convert each nodes cppn output into a contentId int combinedContentID = featureCounts.CPPNOutputToSettingsId(outputs); // Get high level features from contentID and lastRoomType PCGSharpHighLevelFeatures.C_HL_ROOMTYPE lastRoomType = PCGSharpHighLevelFeatures.C_HL_ROOMTYPE.NoPreviousRoom; if (i > 0) // Only the first room should hav NoPreviousRomm { lastRoomType = currentNode.parentNode.roomType; } currentNode.roomType = featureCounts.UpdateFeatures(combinedContentID, lastRoomType); } featureCounts.PrintFeatures(); }
public PCGNeatNodeData(PCGNeatNodeData previousNode, double normTreeDepth, double normTreeTotalSibNum) { parentNode = previousNode; normDepth = normTreeDepth; normSiblingIndex = normTreeTotalSibNum; }