You are on page 1of 3

4CCS1IAI - Introduction to Artificial Intelligence , 2015/16

Members: Cătălin Buruiană (1542235), Ștefan Tudose (1544356), Adrian Delgado-Vlaic (1543927)

The domain instances modelled by this team are concerned with finding the most optimal way, in
a simplified fashion, in which the police could disperse its troops over an area when having to deal with
multiple requests. The reason we chose this domain was that we truly believe that planning could really
benefit in such scenarios thus minimising the resources put in use by nowadays institutions.

1.Types identified and defined in out domain:

- a generic type, “object”, with its instances “law”, “city”, “unlawful” and “location”
-- law describes the type of troops police have at their disposal
-- city is self-explanatory as it states the location (regarded as a city) of the action
-- unlawful represents the type of crimes that are signaled
-- location represents special key locations that police can make use of (e.g. base, areas
or streets)
- The “policeman” (instance of law) type which represents the standard unit police have at their
disposal
- The “specialforces” (instance of law) type that represents a more complex and efficient police
unit that is only called for gangs
- The “thief” (instance of unlawful) type that portrays the most basic form of crime or unlawful
event that can happen in this planner
- The “gang” (instance of unlawful) type that stands for a more complex form of crime that must
be managed with specialforces
- The “base” (instance of location) type where all criminals must be brought to

2. Predicates identified and defined in our domain:


- “(at ?law-or-unlawful - (either law unlawful) ?location - location)” , used to keep track of an
object in a given location
- “(in ?unlawful - unlawful ?law - law)” is used to keep track of the action when law units take
in unlawful entities
- “(in-city ?loc-or-policeman - (either location policeman) ?city - city)”, checks if a location or
policeman is in a city
- “(connected ?from - location ?to - location)”, used to check if two locations are connected
between them
- “ (clear ?x - location)”

3. Functions identified and defined in our domain:


- “(total-cost) - number” , declared for keeping track the total imaginary cost of an action

4. Strips operations identified and defined in our domain:


- “catch-thief” with one thief, one location and one policeman as parameters. If the unlawful is
not in control of law, the thief is then contained by the law object if they are in the same
location.
- “put-thief-in-jail” with one thief, one policeman and base location as parameters. If the thief is
in the same location as the policeman (base) then the thief is moved to jail.
- “catch-gang” with one gang, one location and one specialforces as parameters. If the unlawful
is not in control of law, the gang is then contained by the law object if they are in the same
location.
- “put-gang-in-jail” with one gang, one specialforces and base location as parameters. If the
gang is in the same location as the specialforces (base) then the gang is moved to jail.
- “move-to” with policeman and two locations as parameters. The policeman will be moved
from the first location to the second if they are connected by the predicate connected.
- “send-specialforces” with specialforces and two locations as parameters. The specialforces
will be moved from the first location to the second if they are connected by the predicate
connected.

5.Appendix

(define (domain security)


(:requirements :strips :typing :action-costs)
(:types
unlawful location law city - object
policeman specialforces - law
thief gang - unlawful
base - location)

(:predicates
(at ?law-or-unlawful - (either law unlawful) ?location - location)
(in ?unlawful - unlawful ?law - law)
(in-city ?loc-or-policeman - (either location policeman) ?city - city)
(connected ?from - location ?to - location)
(clear ?x - location)
)

(:functions (total-cost) - number)

(:action catch-thief
:parameters
(?obj - thief
?policeman - policeman
?loc - location)
:precondition
(and (at ?policeman ?loc) (at ?obj ?loc)
)
:effect
(and (not (at ?obj ?loc)) (in ?obj ?policeman) (increase (total-cost) 5) (clear ?loc)
))
(:action put-thief-in-jail
:parameters
(?obj - thief
?policeman - policeman
?loc - base)
:precondition
(and (at ?policeman ?loc) (in ?obj ?policeman))
:effect
(and (not (in ?obj ?policeman)) (at ?obj ?loc) (increase (total-cost) 2)
))
(:action catch-gang
:parameters
(?obj - gang
?specialforces - specialforces
?loc - location)
:precondition
(and (at ?specialforces ?loc) (at ?obj ?loc)
)
:effect (and (not (at ?obj ?loc)) (in ?obj ?specialforces) (clear ?loc) (increase (total-cost) 10)
))
(:action put-gang-in-jail
:parameters
(?obj - gang
?specialforces - specialforces
?loc - base)
:precondition
(and (at ?specialforces ?loc) (in ?obj ?specialforces))
:effect (and (not (in ?obj ?specialforces)) (at ?obj ?loc) (increase (total-cost) 3)
))
(:action move-to
:parameters
(?policeman - policeman
?loc-from - location
?loc-to - location
?city - city
)
:precondition
(and (at ?policeman ?loc-from) (connected ?loc-from ?loc-to) (in-city ?loc-from ?city)
(in-city ?loc-to ?city)
)
:effect (and (not (at ?policeman ?loc-from)) (at ?policeman ?loc-to)
(increase (total-cost) 1)
;(not(clear ?loc-from))
))
(:action send-specialforces
:parameters
(?specialforces - specialforces
?loc-from - location
?loc-to - location)
:precondition
(at ?specialforces ?loc-from)
:effect (and (not (at ?specialforces ?loc-from)) (at ?specialforces ?loc-to) (increase (total-cost) 30)
))
)

You might also like