Skip to content

Commit 04bc699

Browse files
committed
Add a func. which will be necessary in future version with many goals at domain (RefreshFoundedDicts)
1 parent 766cc3a commit 04bc699

3 files changed

Lines changed: 39 additions & 6 deletions

File tree

SharpPDDL/DomainPlanner.cs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

SharpPDDL/SharpPDDL.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- Optimization of making solution some kind of problems
1313
- Fix some issues</PackageReleaseNotes>
1414
<RepositoryUrl>https://github.com/ArBom/SharpPDDL.git</RepositoryUrl>
15-
<Version>0.3.2.7</Version>
15+
<Version>0.3.2.8</Version>
1616
<PackageTags>GOAP;planning;AI;IIoT</PackageTags>
1717
<SignAssembly>false</SignAssembly>
1818
<DelaySign>false</DelaySign>
@@ -24,8 +24,8 @@
2424
<PackageReadmeFile>README.md</PackageReadmeFile>
2525
<PackageProjectUrl>https://github.com/ArBom/SharpPDDL</PackageProjectUrl>
2626
<NeutralLanguage></NeutralLanguage>
27-
<AssemblyVersion>0.3.2.7</AssemblyVersion>
28-
<FileVersion>0.3.2.7</FileVersion>
27+
<AssemblyVersion>0.3.2.8</AssemblyVersion>
28+
<FileVersion>0.3.2.8</FileVersion>
2929
</PropertyGroup>
3030

3131
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

SharpPDDL/Transcriber.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ private Task TranscribeOne(CancellationToken cancellationToken)
110110
NotTranscribedChildYet.Add(new KeyValuePair<Crisscross, List<CrisscrossChildrenCon>>(AddedItem, C.Child.Children));
111111
else
112112
ChildlessCrisscrosses.Add(AddedItem);
113-
114113
}
115114

116115
NotTranscribedChildYet.Remove(keyValuePair);

0 commit comments

Comments
 (0)