Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
IntroductiontoArtificialIntelligence
,2015/16
Members:
Ctlin
Buruian(
1542235),
tefan
Tudose(
1544356
),AdrianDelgadoVlaic(
1543927)
Thedomaininstancesmodelledbythisteamareconcernedwithfindingthemostoptimalway,in
asimplifiedfashion,inwhichthepolicecoulddisperseitstroopsoveranareawhenhavingtodealwith
multiplerequests.Thereasonwechosethisdomainwasthatwetrulybelievethatplanningcouldreally
benefitinsuchscenariosthusminimisingtheresourcesputinusebynowadaysinstitutions.
1.Typesidentifiedanddefinedinoutdomain:
agenerictype,
object
,withitsinstances
law
,
city
,
unlawful
and
location
law
describesthetypeoftroopspolicehaveattheirdisposal
city
isselfexplanatoryasitstatesthelocation(regardedasacity)oftheaction
unlawful
representsthetypeofcrimesthataresignaled
location
representsspecialkeylocationsthatpolicecanmakeuseof(e.g.base,areas
orstreets)
The
policeman
(instanceof
law)
typewhichrepresentsthestandardunitpolicehaveattheir
disposal
The
specialforces
(instanceof
law
)typethatrepresentsamorecomplexandefficientpolice
unitthatisonlycalledfor
gang
s
The
thief
(instanceof
unlawful)
typethatportraysthemostbasicformofcrimeorunlawful
eventthatcanhappeninthisplanner
The
gang
(instanceof
unlawful)
typethatstandsforamorecomplexformofcrimethatmust
bemanagedwith
specialforces
The
base
(instanceof
location
)typewhereallcriminalsmustbebroughtto
2.Predicatesidentifiedanddefinedinourdomain:
(at?laworunlawful(eitherlawunlawful)?locationlocation)
,usedtokeeptrackofan
object
inagivenlocation
(in?unlawfulunlawful?lawlaw)
isusedtokeeptrackoftheactionwhen
law
unitstake
in
unlawful
entities
(incity?locorpoliceman(eitherlocationpoliceman)?citycity)
,checksifa
location
or
policeman
isina
city
(connected?fromlocation?tolocation)
,usedtocheckiftwo
locations
areconnected
betweenthem
(clear?xlocation)
3.Functionsidentifiedanddefinedinourdomain:
(totalcost)number
,declaredforkeepingtrackthetotalimaginarycostofanaction
4.Stripsoperationsidentifiedanddefinedinourdomain:
catchthief
withone
thief
,one
location
andone
policeman
asparameters.Ifthe
unlawful
is
notincontrolof
law
,the
thief
isthencontainedbythe
law
objectiftheyareinthesame
location
.
putthiefinjail
withone
thief
,one
policeman
and
baselocation
asparameters.Ifthe
thief
is
inthesamelocationasthe
policeman
(
base
)thenthe
thief
ismovedtojail.
catchgang
withone
gang
,one
location
andone
specialforces
asparameters.Ifthe
unlawful
isnotincontrolof
law
,the
gang
isthencontainedbythe
law
objectiftheyareinthesame
location
.
putganginjail
withone
gang
,one
specialforces
and
baselocation
asparameters.Ifthe
gang
isinthesamelocationasthe
specialforces
(
base
)thenthe
gang
ismovedtojail.
moveto
with
policeman
andtwo
locations
asparameters.The
policeman
willbemovedfrom
thefirst
location
tothesecondiftheyareconnectedbythepredicate
connected
.
sendspecialforces
with
specialforces
andtwo
locations
asparameters.The
specialforces
willbemovedfromthefirst
location
tothesecondiftheyareconnectedbythepredicate
connected
.
5.Appendix
(define(domainsecurity)
(:requirements:strips:typing:actioncosts)
(:types
unlawfullocationlawcityobject
policemanspecialforceslaw
thiefgangunlawful
baselocation)
(:predicates
(at?laworunlawful(eitherlawunlawful)?locationlocation)
(in?unlawfulunlawful?lawlaw)
(incity?locorpoliceman(eitherlocationpoliceman)?citycity)
(connected?fromlocation?tolocation)
(clear?xlocation)
)
(:functions(totalcost)number)
(:actioncatchthief
:parameters
(?objthief
?policemanpoliceman
?loclocation)
:precondition
(and(at?policeman?loc)(at?obj?loc)
)
:effect
(and (not(at?obj?loc))(in?obj?policeman)(increase(totalcost)5)(clear?loc)
))
(:actionputthiefinjail
:parameters
(?objthief
?policemanpoliceman
?locbase)
:precondition
(and(at?policeman?loc)(in?obj?policeman))
:effect
(and (not(in?obj?policeman))(at?obj?loc)(increase(totalcost)2)
))
(:actioncatchgang
:parameters
(?objgang
?specialforcesspecialforces
?loclocation)
:precondition
(and(at?specialforces?loc)(at?obj?loc)
)
:effect (and (not(at?obj?loc))(in?obj?specialforces)(clear?loc)(increase(totalcost)10)
))
(:actionputganginjail
:parameters
(?objgang
?specialforcesspecialforces
?locbase)
:precondition
(and(at?specialforces?loc)(in?obj?specialforces))
:effect (and (not(in?obj?specialforces))(at?obj?loc)(increase(totalcost)3)
))
(:actionmoveto
:parameters
(?policemanpoliceman
?locfromlocation
?loctolocation
?citycity
)
:precondition
(and (at?policeman?locfrom)(connected?locfrom?locto) (incity?locfrom?city)
(incity?locto?city)
)
:effect (and (not(at?policeman?locfrom)) (at?policeman?locto)
(increase(totalcost)1)
(not(clear?locfrom))
))
(:actionsendspecialforces
:parameters
(?specialforcesspecialforces
?locfromlocation
?loctolocation)
:precondition
(at?specialforces?locfrom)
:effect(and(not(at?specialforces?locfrom))(at?specialforces?locto)(increase(totalcost)30)
))
)