@@ -321,9 +321,43 @@ private void ShowPlanToExternal(List<CrisscrossChildrenCon> PlanList)
321321 PlanGeneratedInDomainPlanner ? . Invoke ( Plan ) ;
322322 }
323323
324- private void RefreshFoundedDicts ( ICollection < GoalPDDL > except , SortedList < string , Crisscross > newSotredSet , Crisscross NewRoot )
324+ private void RefreshFoundedDicts ( SortedList < string , Crisscross > newSotredSet , Crisscross NewRoot )
325325 {
326+ Dictionary < FoungingGoalDetail , SortedSet < Crisscross > > newFoundedGoals = new Dictionary < FoungingGoalDetail , SortedSet < Crisscross > > ( ) ;
327+ Dictionary < Crisscross , List < GoalPDDL > > newFoundedCrisscrosses = new Dictionary < Crisscross , List < GoalPDDL > > ( ) ;
328+ EqComp eqComp = new EqComp ( ) ;
326329
330+ foreach ( var GoalFromFoundedGoals in FoundedGoals )
331+ {
332+ FoungingGoalDetail TempFoungingGoalDetail = new FoungingGoalDetail ( GoalFromFoundedGoals . Key . GoalPDDL ) ;
333+ SortedSet < Crisscross > valueOfNewFoundedGoals = new SortedSet < Crisscross > ( Crisscross . SortCumulativedTransitionCharge ( ) ) ;
334+
335+ foreach ( Crisscross FoundGoal in GoalFromFoundedGoals . Value )
336+ {
337+ if ( ! newSotredSet . Any ( c => c . Key == FoundGoal . Content . CheckSum ) )
338+ continue ;
339+
340+ if ( eqComp . Equals ( newSotredSet [ FoundGoal . Content . CheckSum ] , FoundGoal ) )
341+ {
342+ valueOfNewFoundedGoals . Add ( newSotredSet [ FoundGoal . Content . CheckSum ] ) ;
343+ }
344+ else
345+ {
346+ continue ;
347+ //TODO CrisscrossRefEnum crisscrossRefEnum = new CrisscrossRefEnum(ref NewRoot);
348+ }
349+
350+ if ( newFoundedCrisscrosses . Any ( FC => FC . Key . Equals ( FoundGoal ) ) )
351+ newFoundedCrisscrosses [ FoundGoal ] . Add ( GoalFromFoundedGoals . Key . GoalPDDL ) ;
352+ else
353+ newFoundedCrisscrosses [ FoundGoal ] = new List < GoalPDDL > ( ) { GoalFromFoundedGoals . Key . GoalPDDL } ;
354+ }
355+
356+ newFoundedGoals . Add ( TempFoungingGoalDetail , valueOfNewFoundedGoals ) ;
357+ }
358+
359+ FoundedGoals = newFoundedGoals ;
360+ FoundedCrisscrosses = newFoundedCrisscrosses ;
327361 }
328362
329363 private void GoToCrisscrossAndReachGoals ( KeyValuePair < Crisscross , List < GoalPDDL > > Found )
@@ -371,7 +405,7 @@ private void GoToCrisscrossAndReachGoals(KeyValuePair<Crisscross, List<GoalPDDL>
371405 //zaprzestanie generowania nowych stanów
372406 }
373407
374- RefreshFoundedDicts ( Found . Value , transcriber . NewIndexedStates , transcriber . NewOne ) ;
408+ RefreshFoundedDicts ( transcriber . NewIndexedStates , transcriber . NewOne ) ;
375409 CurrentBuilded . Dispose ( ) ;
376410 CurrentBuilded = transcriber . NewOne ;
377411 }
0 commit comments