0

For example I have the following problem: I have a salesman agent that sells 4 products (a, b, c, and d). it has 10 costumers overall: 3 that need product a, 3 that need product b, 3 that need product c, and 1 that needs product d. not every client has a road (link) to all other clients. the agent is currently at the home of costumer 1 that needs product a and his goal is to get satisfy costumer 10 who needs product d. such that it needs to go through all the clients to get to costumer 10.

Can anyone please help? Thanks!

Blur
  • 85
  • 1
  • 5

1 Answers1

0

You need to set up your graph as a set of 'connectivity predicates' in the init section, eg:

(adjacent l1 l2) (adjacent l2 l3) ...

This represents a connection between l1 and l2 and between l2 and l3; those could be waypoints or the locations of your customers. You then need an action that moves along the graph:

(:action move
     :parameters (?from ?to - location)
     :precondition (and
             (adjacent ?from ?to)
             (at salesman ?from))
     :effect (and
             (at salesman ?to)
             (not (at salesman ?from)))

You then also need an action deliver that makes sure the salesman has some goods, is at a customer, and as an effect the customer has the goods (and the salesman doesn't). Then you set as the goal that all customers have the goods they want, and you should be good to go.

Oliver Mason
  • 2,240
  • 2
  • 15
  • 23