<p>It all depends on the type of planning you're willing to use. If it's 2.1, then you can use numeric variables to do what you want (which is what you found in that example). Figure 1 from the paper [<a href="https://arxiv.org/pdf/1106.4561.pdf" rel="nofollow noreferrer">here</a>] shows it as well.</p>

<p>If it's just classical planning that you're hoping to use, then you need to be a little bit smarter about the encoding. Predicates like <code>(capacity ?vehicle ?num)</code> would need to be created where <code>?num</code> is an object of type <code>number</code> and you create a finite number of them. This can work if your capacities are small enough.</p>

<p>As always, a working example would be helpful to see where it is you're stuck.</p>

<hr>

<p><em>Edit: after confirming PDDL2.1</em></p>

<p>The issues that I can see with the PDDL you posted:</p>

<ul>
<li>Missing a space in <code>at?vehicle</code></li>
<li><p>Your capacity check in the precondition should include the cargo size. E.g.,</p>

<p><code>(&lt; (+ (loadedCargo ?vehicle) (cargosize ?cargo)) (capacity ?vehicle))</code></p></li>
<li>Bad variable name in <code>(at ?c ?vehicle)</code> (should be <code>?cargo</code>)</li>
<li>Your increase should use infix notation and include the cargo size: <code>(increase (loadedCargo ?vehicle) (cargosize ?cargo))</code></li>
<li>You need to remove the cargo from the current location as an effect: <code>(not (at ?cargo ?location))</code></li>
</ul>

<p>I think that's everything I see wrong with the example, but I haven't tested it.</p>
How to check conditions in PDDL?
<p>I am having to create PPDL, in which vehicles transport cargo across a map. A vehicle has a capacity in regards to how much cargo it can carry. Before a vehicle loads cargo onto it, it needs to know whether there is enough capacity for the vehicle to carry that cargo. How do I assign capacity to a vehicle object?</p>

<p>I have seen examples such as:</p>

<pre><code>&lt; (passengers ?lift) (capacity ?lift)
</code></pre>

<p>So clearly, in this scenario, 'lift' has a capacity attribute and a passengers attribute. Could someone provide an example of how this object declaration looks?</p>

<p>Apologies for the poor question, I am new to PDDL and trying to wrap my head around it still.</p>

<p>Here is my load function for loading cargo onto a vehicle:</p>

<pre><code>  (:action load
     :parameters (?vehicle ?cargo ?location)
     :precondition (and (at?vehicle ?location)  (at ?cargo ?location) (&lt; (loadedCargo ?vehicle) (capacity ?vehicle)))
     :effect (and (at ?c ?vehicle) (increase(loadedCargo ?vehicle) + 1))
</code></pre>

<p>Another problem is that there are different types of vehicles, and we need a way of determining which kind of vehicle we are loading onto because different vehicles have different capacities.</p>

<p>I am pretty sure that I am using PDDL 2.1</p>