texlive[74463] branches/branch2024.final/Master/texmf-dist: aiplans
commits+karl at tug.org
commits+karl at tug.org
Wed Mar 5 22:35:02 CET 2025
Revision: 74463
https://tug.org/svn/texlive?view=revision&revision=74463
Author: karl
Date: 2025-03-05 22:35:02 +0100 (Wed, 05 Mar 2025)
Log Message:
-----------
aiplans (branch) (5mar25)
Modified Paths:
--------------
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/README.md
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/README.pdf
branches/branch2024.final/Master/texmf-dist/tex/latex/aiplans/tikzlibraryaiplans.code.tex
Added Paths:
-----------
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.md
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.pdf
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/example-blocksworld.png
Removed Paths:
-------------
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/Aiplans-Introduction.md
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/Aiplans-Introduction.pdf
branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/image.png
Deleted: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/Aiplans-Introduction.md
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/Aiplans-Introduction.md 2025-03-05 21:34:43 UTC (rev 74462)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/Aiplans-Introduction.md 2025-03-05 21:35:02 UTC (rev 74463)
@@ -1,162 +0,0 @@
-# **Instructions for Generating TikZ Diagrams Using LaTeX**
-You could find the example code on: https://github.com/YikaiGe/tikz-aiplans/tree/main/Example/BlocksWorld1
-## **1. Set Up the LaTeX Project**
-
-1. **Create a Folder Structure**:
- - Set up a directory with the following structure:
- - `project_root/`
- - `tikzlibraryaiplans.code.tex` (library code)
- - `domain.tex` (for defining TikZ styles)
- - `main.tex` (the main document that compiles everything)
- - `yourname.tex`, such as `plan-blocksworld1.tex` (for Example 1) or `plan-yousefiposter.tex` (for Example 2)
-
-2. **Main LaTeX Document (`main.tex`)**:
- - Create a `main.tex` file that includes the `domain.tex` and the specific plan file (`yourname.tex`, such as `plan-blocksworld1.tex` for Example 1 or `plan-yousefiposter.tex` for Example 2).
-
- ```latex
- \documentclass[border=1in]{standalone}
- \usepackage{../aiplan} % Include your custom TikZ style definitions
- \begin{document}
- \input{domain} % Load the TikZ style definitions
- \input{yourname} % Load the specific plan
- \end{document}
- ```
-
- Replace `yourname` with the actual plan file name you are using.
-
-
-## **2. Define Custom TikZ Styles (`domain.tex`)**
-
-In this step, you will create a `domain.tex` file where you define custom TikZ styles that represent different actions or states in your diagrams. These styles determine the appearance and behavior of the elements in your diagram, such as shapes, colors, and connections.
-
-Before defining the styles, it is important to understand the structure of the style commands. Each TikZ style you define follows a specific pattern:
-
-<div style="page-break-after: always;"></div>
-
-```latex
-NameOfScheme /. style n args = {num of input parameters}
- {action=
- % number of precs/effs
- {num of precondition lines (on the left side of action)}
- {num of effect lines (on the right side of action)}
- % prec/eff labels
- {sequence of precondition labels}
- {sequence of effect labels}
- % length of precs/effs
- {length of preconditions}
- {length of effects}
- % action name
- {action name}
- % prec/eff label position
- {precondition/effect label position: side or top}
- {height of node}
- }
-
-INIT/.styl={
- init={
- % number of effs
- {number of effects},
- {effects},
- {effects length},
- {height of init}
- }
- }
-
-GOAL/.styl={
- goal={
- {number of preconditons},
- {preconditons},
- {preconditons length},
- {height of goal}
- }
- }
-```
-
-
-
-
----
-
-### **Example: Custom Styles for a Blocksworld Plan (`blocksworld1.tex_domain.tex`)**
-
-In the first example, the styles correspond to actions like `PICKUP`, `PUTDOWN`, `STACK`, and `UNSTACK` in a blocks world scenario:
-
-```latex
-% Define action
-\tikzset{
- INIT/.style={init={8}{gF,onT(B),onT(C),onT(D),clr(A),clr(B),clr(D),{on(A,C)}}{1}{8 cm}},
- PICKUP/.style n args ={1}{STYLE={3}{4}{gF,onT(#1),clr(#1)}{$\neg$gF,gH(#1),$\neg$clr(#1),$\neg$onT(#1)}{PICKUP(#1)}},
- PUTDOWN/.style n args ={1}{STYLE={1}{4}{gH(#1)}{gF,$\neg$gH(#1),onT(#1),clr(#1)}{PUTDOWN(#1)}},
- STACK/.style n args ={2}{STYLE={2}{5}{gH(#1),clr(#2)}{gF,$\neg$gH(#1),onT{(#1,#2)},clr(#1),$\neg$clr(#2)}{STACK{(#1,#2)}}},
- UNSTACK/.style n args ={2}{STYLE={3}{5}{gF,clr(#2),on(#1)}{$\neg$gF,gH{(#1)},$\neg$on(#1),$\neg$clr(#1),clr(#1)}{UNSTACK{(#1,#2)}}},
- GOAL/.style={goal={2}{{on(A,B)},{on(D,C)}}{1}{8 cm}}
-}
-```
-
-- **INIT**: Initializes the starting state of the world.
-- **PICKUP**: Represents the action of picking up an object.
-- **PUTDOWN**: Represents the action of putting down an object.
-- **STACK**: Represents stacking one object on top of another.
-- **UNSTACK**: Represents unstacking one object from another.
-- **GOAL**: Defines the goal state that the plan should achieve.
-
-## **3. Create the Specific Plan File**
-
-
-In this step, you will create the plan file that will generate the desired diagram. This file contains the actual TikZ commands needed to structure and visualize the plan or process you're depicting.
-
-The plan file is where you define the positions and connections of different actions or states. You will place nodes (representing actions or states) and connect them using paths (arrows) to illustrate the flow or sequence in your diagram.
-
----
-
-#### **Example(`blocksworld1.tex`, corresponding to Picture 1):**
-
-In this example, we create a sequential plan for manipulating blocks, where each node represents an action like `UNSTACK`, `PICKUP`, `PUTDOWN`, or `STACK`, and connections between nodes represent causal links.
-
-```latex
-\begin{tikzpicture}
-
- \node[INIT] (init) at (0,0){};
- \node[UNSTACK={A}{C}] (unstackAC) at (6,0) {};
- \node[PUTDOWN={A}] (putdownA) at (12.5,0) {};
- \node[PICKUP={A}] (pickupA) at (19,0) {};
- \node[STACK={A}{B}] (stackAB) at (26,0) {};
- \node[PICKUP={D}] (pickupD) at (33,0) {};
- \node[STACK={D}{C}] (stackDC) at (40,0) {};
- \node[GOAL] (goal) at (47,0){};
-
-
-
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (init-eff-1) node [circle,fill,inner sep=0.1em]{} to [bend left] (unstackAC-pre-1) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (init-eff-5) node [circle,fill,inner sep=0.1em]{} to [bend left] (unstackAC-pre-2) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (init-eff-8) node [circle,fill,inner sep=0.1em]{} to[bend right] (unstackAC-pre-3) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (unstackAC-eff-2) node [circle,fill,inner sep=0.1em]{} to[bend left] (putdownA-pre-1) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (putdownA-eff-1) node [circle,fill,inner sep=0.1em]{} to[bend left] (pickupA-pre-1) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (putdownA-eff-3) node [circle,fill,inner sep=0.1em]{} to[bend right] (pickupA-pre-2) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (putdownA-eff-4) node [circle,fill,inner sep=0.1em]{} to[bend right] (pickupA-pre-3) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (pickupA-eff-2) node [circle,fill,inner sep=0.1em]{} to[bend left] (stackAB-pre-1) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (init-eff-6) node [circle,fill,inner sep=0.1em]{} to [bend left] (stackAB-pre-2) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (stackAB-eff-1) node [circle,fill,inner sep=0.1em]{} to[bend left] (pickupD-pre-1) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (init-eff-4) node [circle,fill,inner sep=0.1em]{} to[bend left] (pickupD-pre-2) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (init-eff-7) node [circle,fill,inner sep=0.1em]{} to[bend right] (pickupD-pre-3) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (pickupD-eff-2) node [circle,fill,inner sep=0.1em]{} to[bend left] (stackDC-pre-1) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (unstackAC-eff-5) node [circle,fill,inner sep=0.1em]{} to[bend right] (stackDC-pre-2) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (stackAB-eff-3) node [circle,fill,inner sep=0.1em]{} to[bend left] (goal-pre-1) node [circle,fill,inner sep=0.1em]{};
- \draw [->, shorten <= 0.2cm, shorten >= 0.1cm] (stackDC-eff-3) node [circle,fill,inner sep=0.1em]{} to[bend left] (goal-pre-2) node [circle,fill,inner sep=0.1em]{};
-
-\end{tikzpicture}
-```
-
-**What This Code Does:**
-- **Nodes:** Each `\node` command places a specific action or state at a defined position on the diagram (e.g., `INIT`, `UNSTACK`, `PUTDOWN`).
-- **Connections:** The `\draw` commands create arrows (causal links) between nodes, showing how one action leads to another.
-- **Resulting Diagram:** This code generates a linear sequence of actions that visually depict a process or plan.
-
-
-
-
-
-## **4. Compile Your Document**
-
-- Make sure you compile the `main.tex` file to generate the diagram. Ensure that all necessary files (`domain.tex`, `yourname.tex`) are correctly referenced and present in the same directory.
-- Use a LaTeX editor or command-line tools to compile `main.tex`. If successful, this will generate the desired diagram based on the TikZ instructions provided in the plan files.
Deleted: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/Aiplans-Introduction.pdf
===================================================================
(Binary files differ)
Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/README.md
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/README.md 2025-03-05 21:34:43 UTC (rev 74462)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/README.md 2025-03-05 21:35:02 UTC (rev 74463)
@@ -4,33 +4,15 @@
## Content
-- [Project Structure](#project-structure)
- [License](#license)
-- [Future Improvements Plan](#future-improvements-plan)
- [Contact Information](#contact-information)
- [Team Members](#team-members)
-## Project Structure
-Aiplans/
-├── **README.md**
-
-├── **README.pdf**
-
-├── **Generating TikZ Diagrams Using LaTeX.md**
-
-├── **Generating TikZ Diagrams Using LaTeX.pdf**
-
-├── **tikzlibrary<aiplans>.code.tex**
-
-└── **License.txt**
-
-
### Explanation
- **README**: This file provides an overview of the project, including installation instructions, system requirements, and other essential information.
-- **Generating TikZ Diagrams Using LaTeX**: Detailed instructions on how to use the TikZ library included in this package. It covers the steps needed to generate diagrams using LaTeX.
- **tikzlibrary<aiplans>.code.tex**: The core of the project, this file contains the TikZ library specifically designed for generating AI plan diagrams. This package is crucial for the functionality provided by this project.
- **License.txt**: The license file outlines the terms under which the package can be used, modified, and distributed.
@@ -43,7 +25,7 @@
## Contact Information
If you have any questions, feedback, or suggestions regarding this project, please feel free to reach out to us. We are always happy to assist and appreciate your input.
-Email: geyikai912 at gmail.com
+Email: pascal.bercher -~AT~- anu.edu.au; geyikai912 -~AT~- gmail.com
GitHub Issues: https://github.com/YikaiGe/tikz-aiplans/issues
Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/README.pdf
===================================================================
(Binary files differ)
Added: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.md
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.md (rev 0)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.md 2025-03-05 21:35:02 UTC (rev 74463)
@@ -0,0 +1,176 @@
+# Instructions for Generating TikZ Diagrams Using LaTeX
+
+You will need the following files:
+
+- `tikzlibraryaiplans.code.tex` (library code)
+- `main.tex` (the main document)
+- `domain.tex` (for defining the action schemas)
+- `plan.tex` (the plan that uses the defined actions)
+
+
+## Main LaTeX Document
+
+Create a `main.tex` file that includes the domain file (such as `blocksworld_domain.tex`) and the specific plan file(s) (such as `blocksworld_plan.tex` in our example).
+
+ ```latex
+ \documentclass[border=1in]{standalone}
+ \usepackage{tikz}
+ \usetikzlibrary{aiplans}
+ \begin{document}
+ \input{domain} % Action schema specification
+ \input{plan} % The plan to display
+ \end{document}
+ ```
+
+## Define Action Model -- aka the Domain
+
+In this step, you will create a `domain.tex` file where you define your action model, not unlike in HDDL. I.e., you provide action schemata (that take parameters) that you can later use with different instantiations of those parameters (you will later see an example).
+
+Each action schema you define follows a specific pattern:
+
+<div style="page-break-after: always;"></div>
+
+```latex
+NameOfScheme /. style n args = {num of input parameters}
+ {action=
+ % number of precs/effs
+ {num of precondition lines (on the left side of action)}
+ {num of effect lines (on the right side of action)}
+ % the actual prec/eff to display
+ {sequence of precondition labels}
+ {sequence of effect labels}
+ % length of precs/effs
+ {length of preconditions}
+ {length of effects}
+ % action name to display
+ {action name}
+ % prec/eff label position
+ {precondition/effect label position: above lines or on their side}
+ {height of node}
+ }
+```
+
+That is, for each action schema you provide one such definition that you can later reference in your plan with different arguments/parameters. In a Blocksworld example, you may define an action schema `stack()` with two arguments (i.e., two block constants) and then in the plan use that schema multiple times with different constants.
+
+Note that often several actions might share several attributes such as precondition of effect length. Hence, in our example, we factored out those properties as follows:
+
+```latex
+\tikzset{
+ STYLE/.style n args = {5}{
+ action={#1}{#2}{#3}{#4}{1}{1.4}{#5}{0}{6 cm}
+ }
+}
+```
+
+Note that here you could also specify any arguments that you want to apply to all actions, such as different widths, or fill coloring. For example, by simply appending `minimum width=2cm` to change our default width.
+
+Then, when defining our action schema, each action uses this pre-defined style so that we have to define shared properties only once. In our example, all precondition lengths are 1cm and all effects have length 14 cm. Also, all preconditions/effects occur on the left/right of all actions (rather than above/below) and, finally, all actions have a height of 6 cm. Based on this factored out `STYLE`, we define our actions as follows:
+
+```latex
+\tikzset{
+ PICKUP/.style n args = {1}{STYLE={3}{4}{gF,onT(#1),clr(#1)}
+ {$\neg$gF,gH(#1),$\neg$clr(#1),$\neg$onT(#1)}
+ {pickup(#1)}},
+ PUTDOWN/.style n args = {1}{STYLE={1}{4}{gH(#1)} # of precs/effs; then precs
+ {gF,$\neg$gH(#1),onT(#1),clr(#1)}
+ {putdown(#1)}},
+ STACK/.style n args = {2}{STYLE={2}{5}{gH(#1),clr(#2)} # of precs/effs; then precs
+ {gF,$\neg$gH(#1),onT{(#1,#2)},clr(#1),$\neg$clr(#2)}
+ {stack{(#1,#2)}}},
+ UNSTACK/.style n args = {2}{STYLE={3}{5}{gF,clr(#2),on(#1)}
+ {$\neg$gF,gH{(#1)},$\neg$on(#1),$\neg$clr(#1),clr(#1)}
+ {unstack{(#1,#2)}}}
+}
+```
+
+In the example above, the preconditions and effects have the following meaning:
+- gH: gripper holds the respective object
+- gF: the gripper is free, hence doesn't hold any object
+- clr: the respective block is clear, i.e., no other block is above it
+- onT: the respective block sits directly on the table
+- on: one block (first argument) sits on the other block (second argument)
+
+Note that you can also set action schema-specific properties, just like we have done above (with the minimum width) for *all* action schemata. You do this simply by adding the respective property to the respective action schema definition. Just make sure to add it after loading the action macro. For example, to fill all pickup actions in red, specify provide the following definition:
+
+```latex
+PICKUP/.style n args = {1}{STYLE={3}{4}{gF,onT(#1),clr(#1)}
+ {$\neg$gF,gH(#1),$\neg$clr(#1),$\neg$onT(#1)}
+ {pickup(#1)},fill=red},
+```
+
+Finally, note that we provide a pre-defined way to define the initial state and goal description.
+
+```latex
+INIT/.style={
+ init={
+ {number of effects},
+ {effects},
+ {effects length},
+ {height of init}}}
+GOAL/.style={
+ goal={
+ {number of preconditions},
+ {preconditions},
+ {preconditions length},
+ {height of goal}}}
+```
+
+In our Blocksworld example, it would look as follows:
+
+```latex
+\tikzset{
+ INIT/.style = {init={8}{gF,onT(B),onT(C),onT(D),clr(A),clr(B),clr(D),{on(A,C)}}{1.2}{8 cm}},
+ GOAL/.style = {goal={2}{{on(A,B)},{on(D,C)}}{1.2}{8 cm}}
+}
+```
+
+
+## Specify your Plan
+
+A plan is a simple tikzgraphic, with the difference that we now offer two special labels:
+- nodes can use the predefined schemata (to be instantiated as seen in the example)
+- draw commands feature a causal link command, which draw dots on the two anchors of the respective link
+
+```latex
+\begin{tikzpicture}
+ \node[INIT] (init) {};
+ \node[UNSTACK={A}{C}] (unstackAC) [right=3.5cm of init] {};
+ \node[PUTDOWN={A}] (putdownA) [right=3.5cm of unstackAC] {};
+ \node[PICKUP={A}] (pickupA) [right=3.5cm of putdownA] {};
+ \node[STACK={A}{B}] (stackAB) [right=3.5cm of pickupA] {};
+ \node[PICKUP={D}] (pickupD) [right=3.5cm of stackAB] {};
+ \node[STACK={D}{C}] (stackDC) [right=3.5cm of pickupD] {};
+ \node[GOAL] (goal) [right=3.5cm of stackDC] {};
+
+ \draw [causalLink, bend left] (init-eff-1) to (unstackAC-pre-1);
+ \draw [causalLink, bend left] (init-eff-5) to (unstackAC-pre-2);
+ \draw [causalLink, bend right] (init-eff-8) to (unstackAC-pre-3);
+ \draw [causalLink, bend left] (unstackAC-eff-2) to (putdownA-pre-1);
+ \draw [causalLink, bend left] (putdownA-eff-1) to (pickupA-pre-1);
+ \draw [causalLink, bend right] (putdownA-eff-3) to (pickupA-pre-2);
+ \draw [causalLink, bend right] (putdownA-eff-4) to (pickupA-pre-3);
+ \draw [causalLink, bend left] (pickupA-eff-2) to (stackAB-pre-1);
+ \draw [causalLink, bend right] (init-eff-6) to (stackAB-pre-2);
+ \draw [causalLink, bend left] (stackAB-eff-1) to (pickupD-pre-1);
+ \draw [causalLink, bend left] (init-eff-4) to (pickupD-pre-2);
+ \draw [causalLink, bend right=20] (init-eff-7) to (pickupD-pre-3);
+ \draw [causalLink, bend left] (pickupD-eff-2) to (stackDC-pre-1);
+ \draw [causalLink, bend right=20] (unstackAC-eff-5) to (stackDC-pre-2);
+ \draw [causalLink, bend left] (stackAB-eff-3) to (goal-pre-1);
+ \draw [causalLink, bend left] (stackDC-eff-3) to (goal-pre-2);
+\end{tikzpicture}
+```
+
+You can see, among others, that the `stack` schema is drawn twice, once with arguments `A` and `B` and once with arguments `D` and `C`. Also, just like you were able to specify action schema-specific properties, you can also do that per search node. For example, although above both `stack` nodes would show all the same properties, you could, for example, define the following:
+
+```latex
+ \node[STACK={D}{C},fill=red] (stackDC) [right=3.5cm of pickupD] {};
+```
+
+which would only fill that specific stack action in red, but not any others.
+
+The plan is then depicted as follows:
+
+
+
+We also provide our example directly in compilable code.
\ No newline at end of file
Property changes on: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.pdf
===================================================================
(Binary files differ)
Index: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.pdf
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.pdf 2025-03-05 21:34:43 UTC (rev 74462)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.pdf 2025-03-05 21:35:02 UTC (rev 74463)
Property changes on: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/aiplans-Introduction.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/example-blocksworld.png
===================================================================
(Binary files differ)
Index: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/example-blocksworld.png
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/example-blocksworld.png 2025-03-05 21:34:43 UTC (rev 74462)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/example-blocksworld.png 2025-03-05 21:35:02 UTC (rev 74463)
Property changes on: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/example-blocksworld.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Deleted: branches/branch2024.final/Master/texmf-dist/doc/latex/aiplans/image.png
===================================================================
(Binary files differ)
Modified: branches/branch2024.final/Master/texmf-dist/tex/latex/aiplans/tikzlibraryaiplans.code.tex
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/latex/aiplans/tikzlibraryaiplans.code.tex 2025-03-05 21:34:43 UTC (rev 74462)
+++ branches/branch2024.final/Master/texmf-dist/tex/latex/aiplans/tikzlibraryaiplans.code.tex 2025-03-05 21:35:02 UTC (rev 74463)
@@ -1,44 +1,63 @@
-% Author: Yikai Ge <geyikai912ATgmail.com>
-
-% Version: 2.0 (2025-02-24)
+% Author: Pascal Bercher <pascal.bercher -~AT~- anu.edu.au>
+% Version: 3.0 (2025-03-05)
%
% Change Log:
-% 1.0 -> 2.0
-% - Improved stability and optimized the code.
-% - The spacing between labels is now automatically calculated and evenly distributed.
+% 2.0 -> 3.0
+% - Added causalLink label macro
+% - Removed code duplication
+% - Renamed files and folders standardized naming
+% - Revised instructions
-
-
% Load necessary packages and styles
\RequirePackage{tikz}
\RequirePackage{listofitems}
% Load required TikZ libraries directly
-\usetikzlibrary{calc}
-\usetikzlibrary{decorations.pathreplacing, decorations.markings}
+\usetikzlibrary{calc, positioning, decorations.pathreplacing, decorations.markings}
+% this allows the definition of causal links, which place dots on the start and end of the link
+\tikzset{
+ causalLink/.style={
+ ->,
+ shorten <= 0.15cm,
+ shorten >= 0.15cm,
+ postaction={
+ decorate,
+ decoration={
+ markings,
+ % Not using exaxtly 0 and 1 is a hack sugested by chatGPT
+ % because otherwise for long links the goal dots are not placed
+ mark=at position 0.0001 with {\fill circle[radius=1pt];},
+ mark=at position 0.9999 with {\fill circle[radius=1pt];}
+ }
+ }
+ }
+}
+% Name of Action/.style n args={number of objects}{
+% {action=
+% % number of precs/effs
+% {num of precondition lines (on the left side of action)}
+% {num of effect lines (on the right side of action)}
+% % prec/eff labels
+% {sequence of precondition labels}
+% {sequence of effect labels}
+% % length of precs/effs
+% {length of preconditions}
+% {length of effects}
+% % action name
+% {action name}
+% % prec/eff label position
+% {precondition/effect label position: side or top}
+% {height of node}
+% }
-% Name of Action/.styl n args={number of objects}{
-% action={
-% {number of preconditions},
-% {number of effects},
-% {preconditions},
-% {effects},
-% {precondition length},
-% {effects length},
-% {label of action},
-% {position of label (0 for on top, other number for side)},
-% {height of node}
-% }
-% }
-
\tikzset{
action/.style n args={9}{
draw,
+ rounded corners,
minimum width=3cm,
fill=cyan,
- rounded corners,
minimum height={#9},
label={center:#7},
append after command={
@@ -58,7 +77,7 @@
\readlist\labellist{#3}
\foreach \i in {1,...,#1} {
% Precondition coordinates and lines
- \coordinate (\nodename-pre-\i) at ([xshift=-#5cm, yshift=(-\i + (#1 + 1)/2) * #9/#1] \nodename.west);
+ \coordinate (\nodename-pre-\i) at ([xshift=-#5cm, yshift=#9/2-#9/(#1+1)*(\i)] \nodename.west);
\draw (\nodename.west |- \nodename-pre-\i) -- +(-#5,0) node [midway, above, sloped, font=\scriptsize] {\labellist[\i]};
}
\fi;
@@ -66,7 +85,7 @@
\ifnum#2>0
\foreach \j in {1,...,#2} {
% Effect coordinates and lines
- \coordinate (\nodename-eff-\j) at ([xshift=#6cm, yshift=(-\j + (#2 + 1)/2) * #9/#2] \nodename.east);
+ \coordinate (\nodename-eff-\j) at ([xshift=#6cm, yshift=#9/2-#9/(#2+1)*(\j)] \nodename.east);
\draw (\nodename.east |- \nodename-eff-\j) -- +(#6,0) node [midway, above, sloped, font=\scriptsize] {\labellist[\j]};
}
\fi;
@@ -75,7 +94,7 @@
\readlist\labellist{#3}
\foreach \i in {1,...,#1} {
% Precondition coordinates and lines
- \coordinate (\nodename-pre-\i) at ([xshift=-#5 cm, yshift=(-\i + (#1 + 1)/2) * #9/#1] \nodename.west);
+ \coordinate (\nodename-pre-\i) at ([xshift=-#5cm, yshift=#9/2-#9/(#1+1)*(\i)] \nodename.west);
\draw (\nodename.west |- \nodename-pre-\i) -- +(-#5,0) node [xshift=-(#5+0.5cm), sloped, font=\scriptsize]{\labellist[\i]};
}
\fi;
@@ -83,7 +102,7 @@
\ifnum#2>0
\foreach \j in {1,...,#2} {
% Effect coordinates and lines
- \coordinate (\nodename-eff-\j) at ([xshift=#6 cm, yshift=(-\j + (#2 + 1)/2) * #9/#2] \nodename.east);
+ \coordinate (\nodename-eff-\j) at ([xshift=#6 cm, yshift=#9/2-#9/(#2+1)*(\j)] \nodename.east);
\draw (\nodename.east |- \nodename-eff-\j) -- +(#6,0) node [xshift=(#5+0.5 cm), font=\scriptsize] {\labellist[\j]};
}
\fi;
@@ -95,23 +114,19 @@
}
}
-% INIT/.styl={
+% INIT/.style={
% init={
% {number of effects},
% {effects},
% {effects length},
-% {height of init}
-% }
-% }
+% {height of init}}}
-% GOAL/.styl={
+% GOAL/.style={
% goal={
-% {number of preconditons},
-% {preconditons},
-% {preconditons length},
-% {height of goal}
-% }
-% }
+% {number of preconditions},
+% {preconditions},
+% {preconditions length},
+% {height of goal}}}
\tikzset{
base/.style n args={6}{
@@ -125,7 +140,7 @@
\setsepchar{,}
\readlist\labellist{#2}
\foreach \i in {1,...,#1} {
- \coordinate (\nodename-#5-\i) at ([xshift=#3 cm, yshift=(-\i + (#1)/2+0.25) * #6/#1] \nodename.#4);
+ \coordinate (\nodename-#5-\i) at ([xshift=#3 cm, yshift=#6/2-#6/(#1+1)*(\i)] \nodename.#4);
\draw (\nodename.#4 |- \nodename-#5-\i) -- +(#3,0)
node [midway, above, sloped, font=\scriptsize] {\labellist[\i]};
}
@@ -147,8 +162,4 @@
goal/.style n args={4}{
base={#1}{#2}{-#3}{west}{pre}{#4}
}
-}
-
-
-
-
+}
\ No newline at end of file
More information about the tex-live-commits
mailing list.