MacroGenerators 1.0.1

dotnet add package MacroGenerators --version 1.0.1
                    
NuGet\Install-Package MacroGenerators -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MacroGenerators" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MacroGenerators" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="MacroGenerators" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MacroGenerators --version 1.0.1
                    
#r "nuget: MacroGenerators, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=MacroGenerators&version=1.0.1
                    
Install MacroGenerators as a Cake Addin
#tool nuget:?package=MacroGenerators&version=1.0.1
                    
Install MacroGenerators as a Cake Tool

<p align="center"> <img src="https://github.com/kris701/MacroGenerators/assets/22596587/4f77844a-36e8-4ab2-8cf7-5e50d5fd2f12" width="200" height="200" /> </p>

Build and Publish Nuget Nuget GitHub last commit (branch) GitHub commit activity (branch) Static Badge Static Badge Static Badge

MacroGenerators

This project is a collection of different macro generators. You can run the different macro generators by calling the CLI tool:

dotnet run --domain domain.pddl --problem problem.pddl --plans plan1.plan plan2.plan ... --generator Sequential

You can also find this project as a package on the NuGet Package Manager.

Sequential Macro Generator

The sequential macro generactor can generate lifted macros based on reoccuring sequences in plans. It works as follows

  1. Find all the possible sequence combinations possible across all the given plans.
  2. Sort all sequences by occurence.
  3. Remove all sequences where there is no inner-entanglements (e.g. pick ball1 rooma left, pick ball2 rooma right).
  4. Foreach remaining sequence, combine the actions into a macro.
  5. Return found macros.

This results in macros that can look like this (for the gripper domain):

(:action pick-pick-move-drop-drop
  :parameters (?ball1 ?ball2 ?rooma ?roomb ?left ?right)
  :precondition  
    (and 
      (free ?left) (free ?right)
      (ball ?ball1) (ball ?ball2)
      (room ?rooma) (room ?roomb)
      (gripper ?left) (gripper ?right)
      (at-robby ?rooma) 
      (at ?ball1 ?rooma)
      (at ?ball2 ?rooma)
    )
    :effect 
    (and 
      (at-robby ?roomb)
      (not (at-robby ?rooma))
      (not (at ?ball1 ?rooma))
      (not (at ?ball2 ?rooma))
      (at ?ball1 ?roomb)
      (at ?ball2 ?roomb)
    )
)

That effectively takes two balls, moves to the other room and drops them both, consisting of 5 actions in total.

Examples

To find all macros for a given set plans and a domain:

PDDLDecl decl = new PDDLDecl(...)
IMacroGenerator<List<ActionPlan>> generator = new SequentialMacroGenerator(decl);
List<ActionPlan> plans = new List<ActionPlan>(...);
List<ActionDecl> macros = generator.FindMacros(plans);

To find top 10 macros for a given set of plans and a domain:

PDDLDecl decl = new PDDLDecl(...)
IMacroGenerator<List<ActionPlan>> generator = new SequentialMacroGenerator(decl);
List<ActionPlan> plans = new List<ActionPlan>(...);
List<ActionDecl> macros = generator.FindMacros(plans, 10);
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MacroGenerators:

Package Downloads
MetaActionGenerators

A package to generate meta action candidates.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 180 5/10/2024
1.0.0 115 5/10/2024