public void SendBestIndividuals2(ParetoNode <S> top_node, int number_individuals_exchanged) { for (int i = 0; i < number_individuals_exchanged; ++i) { S solution = Population[i].Clone() as S; top_node.EvaluateAndAdd(solution); } }
public ParetoNode <S> CreateNode(string node_id) { ParetoNode <S> node = new ParetoNode <S>(mProblem); node.Population.Config.Copy(mConfig); node.NodeId = node_id; mParetoNodes[node_id] = node; return(node); }
public void LinkTop2Bottom(ParetoNode <S> top_node, ParetoNode <S> bottom_node) { if (mTopDownNodes.ContainsKey(top_node)) { mTopDownNodes[top_node].Add(bottom_node); } if (mBottomUpNodes.ContainsKey(bottom_node)) { mBottomUpNodes[bottom_node].Add(top_node); } }
public void SendRandomIndividuals2(ParetoNode <S> bottom_node, int number_individuals_exchanged) { List <S> solutions = mPopulation.Solutions.ToList(); RandomShuffle(solutions); for (int i = 0; i < number_individuals_exchanged; ++i) { S solution = solutions[i].Clone() as S; bottom_node.EvaluateAndAdd(solution); } }
public void Link2BottomLayer(HAPMOEALayer <S> bottom_layer) { foreach (string node_i in mParetoNodes.Keys) { ParetoNode <S> current_layer_node = mParetoNodes[node_i]; foreach (string node_j in bottom_layer.mParetoNodes.Keys) { ParetoNode <S> bottom_layer_node = bottom_layer.mParetoNodes[node_j]; if (!mTopDownNodes.ContainsKey(current_layer_node)) { mTopDownNodes[current_layer_node] = new List <ParetoNode <S> >(); } if (!bottom_layer.mBottomUpNodes.ContainsKey(bottom_layer_node)) { bottom_layer.mBottomUpNodes[bottom_layer_node] = new List <ParetoNode <S> >(); } mTopDownNodes[current_layer_node].Add(bottom_layer_node); bottom_layer.mBottomUpNodes[bottom_layer_node].Add(current_layer_node); } } }