-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
graphplan fixes. getting there - a couple of test cases pass now.
- Loading branch information
Showing
5 changed files
with
50 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 28 additions & 63 deletions
91
src/SCClassicalPlanning.Tests/Planning/GraphPlan/GraphPlanTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,29 @@ | ||
////using FluentAssertions; | ||
////using FlUnit; | ||
////using SCClassicalPlanning.ExampleDomains.FromAIaMA; | ||
////using SCFirstOrderLogic; | ||
////using static SCClassicalPlanning.ExampleDomains.FromAIaMA.BlocksWorld; | ||
using FluentAssertions; | ||
using FlUnit; | ||
using SCClassicalPlanning.ExampleDomains.FromAIaMA; | ||
using SCFirstOrderLogic; | ||
using static SCClassicalPlanning.ExampleDomains.FromAIaMA.BlocksWorld; | ||
|
||
////namespace SCClassicalPlanning.Planning.GraphPlan | ||
////{ | ||
//// public static class GraphPlanTests | ||
//// { | ||
//// public static Test CreatedPlanValidity => TestThat | ||
//// .GivenTestContext() | ||
//// .AndEachOf(() => new Problem[] | ||
//// { | ||
//// AirCargo.ExampleProblem, | ||
//// BlocksWorld.ExampleProblem, | ||
//// SpareTire.ExampleProblem, | ||
//// MakeBigBlocksWorldProblem(), | ||
//// }) | ||
//// .When((_, tc) => | ||
//// { | ||
//// var planner = new GraphPlan(); | ||
//// return planner.CreatePlan(tc); | ||
//// }) | ||
//// .ThenReturns() | ||
//// .And((_, tc, pl) => tc.Goal.IsSatisfiedBy(pl.ApplyTo(tc.InitialState)).Should().BeTrue()) | ||
//// .And((cxt, tc, pl) => cxt.WriteOutputLine(new PlanFormatter(tc.Domain).Format(pl))); | ||
|
||
//// private static Problem MakeBigBlocksWorldProblem() | ||
//// { | ||
//// Constant blockA = new(nameof(blockA)); | ||
//// Constant blockB = new(nameof(blockB)); | ||
//// Constant blockC = new(nameof(blockC)); | ||
//// Constant blockD = new(nameof(blockD)); | ||
//// Constant blockE = new(nameof(blockE)); | ||
|
||
//// return BlocksWorld.MakeProblem( | ||
//// initialState: new( | ||
//// Block(blockA) | ||
//// & Equal(blockA, blockA) | ||
//// & Block(blockB) | ||
//// & Equal(blockB, blockB) | ||
//// & Block(blockC) | ||
//// & Equal(blockC, blockC) | ||
//// & Block(blockD) | ||
//// & Equal(blockD, blockD) | ||
//// & Block(blockE) | ||
//// & Equal(blockE, blockE) | ||
//// & On(blockA, Table) | ||
//// & On(blockB, Table) | ||
//// & On(blockC, blockA) | ||
//// & On(blockD, blockB) | ||
//// & On(blockE, Table) | ||
//// & Clear(blockD) | ||
//// & Clear(blockE) | ||
//// & Clear(blockC)), | ||
//// goal: new( | ||
//// On(blockA, blockB) | ||
//// & On(blockB, blockC) | ||
//// & On(blockC, blockD) | ||
//// & On(blockD, blockE))); | ||
//// } | ||
//// } | ||
////} | ||
namespace SCClassicalPlanning.Planning.GraphPlan | ||
{ | ||
public static class GraphPlanTests | ||
{ | ||
public static Test CreatedPlanValidity => TestThat | ||
.GivenTestContext() | ||
.AndEachOf(() => new Problem[] | ||
{ | ||
SpareTire.ExampleProblem, | ||
//AirCargo.ExampleProblem, | ||
BlocksWorld.ExampleProblem, | ||
//BlocksWorld.LargeExampleProblem, | ||
}) | ||
.When((_, tc) => | ||
{ | ||
var planner = new GraphPlan(); | ||
return planner.CreatePlan(tc); | ||
}) | ||
.ThenReturns() | ||
.And((_, tc, pl) => tc.Goal.IsSatisfiedBy(pl.ApplyTo(tc.InitialState)).Should().BeTrue()) | ||
.And((cxt, tc, pl) => cxt.WriteOutputLine(new PlanFormatter(tc.Domain).Format(pl))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters