jadex.examples.cleanerworld.single
Agent CleanerNoDelib
- agent CleanerNoDelib
The cleaner world as single agent version.
This version does not use deliberation mechanisms.
It has these goals:
a) maintain its battery state.
b) clean-up waste and carry it to the wastebin.
c) patrol at night.
Configuration Summary |
default configuration |
default
|
daytime
belief boolean daytime
- location of objects
- Default fact:
true
my_location
belief Location my_location
- Default fact:
new Location(0, 0)
wastebin_location
belief Location wastebin_location
- Default fact:
new Location(0.25, 0.25)
chargingstation_location
belief Location chargingstation_location
- Default fact:
new Location(0.25, 0.75)
speed
belief double speed
- state info
- Default fact:
0.1
vision
belief double vision
- Default fact:
0.1
chargestate
belief double chargestate
- Default fact:
1.0
carrieswaste
belief boolean carrieswaste
- Default fact:
false
is_cleaning
belief boolean is_cleaning
- Default fact: (dynamic)
$goalbase.getGoals("achievecleanup").length>0
is_loading
belief boolean is_loading
- Default fact:
false
gui
belief CleanerGui gui
- Default fact:
new CleanerGui($agent.getExternalAccess())
waste_locations
beliefset Location waste_locations
known_waste_locations
beliefset Location known_waste_locations
patrolpoints
beliefset Location patrolpoints
- Default facts:
new Location(0.1, 0.1)
new Location(0.1, 0.9)
new Location(0.3, 0.9)
new Location(0.3, 0.1)
new Location(0.5, 0.1)
new Location(0.5, 0.9)
new Location(0.7, 0.9)
new Location(0.7, 0.1)
new Location(0.9, 0.1)
new Location(0.9, 0.9)
performlookforwaste
performgoal performlookforwaste()
- BDI flags:
- retry: true
- retry delay: 0
- exclude: never
- random selection: false
- post to all: false
- Context Condition:
!$beliefbase.is_cleaning
&& !$beliefbase.is_loading
&& $beliefbase.daytime
performpatrol
performgoal performpatrol()
- BDI flags:
- retry: true
- retry delay: 0
- exclude: never
- random selection: false
- post to all: false
- Context Condition:
!$beliefbase.is_loading
&& !$beliefbase.daytime
achievecleanup
achievegoal achievecleanup(Location waste_location)
- Parameters:
- in parameter
waste_location
Default value:
select one Location $waste from $beliefbase.known_waste_locations
order by $waste.getDistance($beliefbase.my_location)
- BDI flags:
- retry: true
- retry delay: 0
- exclude: when_failed
- random selection: false
- post to all: false
- Context Condition:
!$beliefbase.is_loading
&& $beliefbase.daytime
- Creation Condition:
$beliefbase.known_waste_locations.length>0
&& !$beliefbase.is_cleaning
&& !$beliefbase.carrieswaste
- Drop Condition:
!$beliefbase.carrieswaste &&
(!$beliefbase.getBeliefSet("known_waste_locations").containsFact($goal.waste_location)
|| !(select one Location $waste from $beliefbase.known_waste_locations
order by $beliefbase.my_location.getDistance($waste))
.equals($goal.waste_location))
achievemoveto
achievegoal achievemoveto(Location location)
- Parameters:
- in parameter
location
- BDI flags:
- retry: true
- retry delay: 0
- exclude: when_tried
- random selection: false
- post to all: false
- Target Condition:
$beliefbase.my_location.isNear($goal.location)
maintainbatteryloaded
maintaingoal maintainbatteryloaded()
- BDI flags:
- retry: true
- retry delay: 0
- exclude: when_tried
- random selection: false
- post to all: false
- recur: false
- recur delay: 0
- Maintain Condition:
$beliefbase.chargestate > 0.2
- Target Condition:
$beliefbase.chargestate >= 1.0
randomwalk
standard plan randomwalk()
- Plan body:
- Plan trigger:
- Goals:
performlookforwaste
patrol
standard plan patrol()
- Plan body:
- Plan trigger:
- Goals:
performpatrol
cleanup
standard plan cleanup(Location waste_location)
- Parameters:
- in parameter
waste_location
(goal mappings: achievecleanup.waste_location)
- Plan body:
- Plan trigger:
- Goals:
achievecleanup
loadbattery
standard plan loadbattery()
- Plan body:
- Plan trigger:
- Goals:
maintainbatteryloaded
moveto
standard plan moveto(Location location)
- Parameters:
- in parameter
location
(goal mappings: achievemoveto.location)
- Plan body:
- Plan trigger:
- Goals:
achievemoveto
cleanup_waste_beliefs
standard plan cleanup_waste_beliefs()
- Plan body:
- Plan trigger:
- Condition
(select one Location $known_waste
from $beliefbase.known_waste_locations
where
$known_waste.isNear($beliefbase.my_location, $beliefbase.vision)
&&
(select one Location $waste from $beliefbase.waste_locations
where $waste.isNear($known_waste)
) == null
) != null
wasteseen
standard plan wasteseen()
- Plan body:
- Plan trigger:
- Condition
(select one Location $wasteloc
from $beliefbase.waste_locations
where $wasteloc.isNear($beliefbase.my_location, $beliefbase.vision) &&
!$beliefbase.getBeliefSet("known_waste_locations").containsFact($wasteloc))
!= null
query_all_vanished_wastes
expression query_all_vanished_wastes
- Expression:
select Location $known_waste from $beliefbase.known_waste_locations
where $known_waste.isNear($beliefbase.my_location, $beliefbase.vision)
&& (select one Location $waste from $beliefbase.waste_locations
where $waste.isNear($known_waste)) == null
query_new_waste_location
expression query_new_waste_location
- Expression:
select Location $wasteloc from $beliefbase.waste_locations
where $wasteloc.isNear($beliefbase.my_location, $beliefbase.vision) &&
!$beliefbase.getBeliefSet("known_waste_locations").containsFact($wasteloc)
nearest_waste
expression nearest_waste
- Expression:
select one Location $loc
from $beliefbase.waste_locations
where $loc.isNear($mouseloc, $tol.doubleValue())
- Parameter:
Location $mouseloc
- Parameter:
Double $tol
default
default configuration default
- Initial Goals:
- performlookforwaste
- performpatrol
- maintainbatteryloaded
Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples. Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.