Package jason.stdlib
Internal actions of Jason.
BDI
desire
: check agent's desires.drop_desire
: remove one agent's desire.drop_all_desires
: remove agent's desires.intend
: check agent's intentions.drop_intention
: remove one agent's intention.drop_all_intentions
: remove all agent's intentions.intention
: get details of the state of Jason intentions.succeed_goal
: abort some goal with success.fail_goal
: abort some goal with failure.drop_event
: remove one event.drop_all_events
: remove events in the interpreter.suspend
: suspend intentions.resume
: resume suspended intentions.suspended
: check agent's suspended goals.
Belief base
abolish
: removes some beliefs.belief
: consults some beliefs.findall
: finds all answers for a query.setof
: finds a set of answers for a query.count
: counts the number of solutions of some query.namespace
: checks whether the argument is a name space.relevant_rules
: gets a list of rules.list_rules
: prints out the rules in the current belief base.
Plan Library
add_plan
: add new plans.remove_plan
: remove a plan.plan_label
: get the label of a plan.relevant_plans
: get a list of plans.relevant_plan
: backtracking based version of .relevant_plans.list_plans
: print out the plans in the current plan library.
Communication
send
: send messages.broadcast
: broadcast messages.my_name
: get the agent's name.all_names
: get the names of all agents in the system.df_register
: register a service in the Directory Facilitator.df_deregister
: removes a service in the Directory Facilitator.df_search
: search for a service in the Directory Facilitator.df_subscribe
: subscribe for new providers of a service in the Directory Facilitator.
Lists, Sets and other collections
member
: list members.length
: size of lists.empty
: check whether the list is empty.concat
: concat lists.delete
: delete members of a lists.reverse
: reverse lists.shuffle
: shuffle the elements of a list.nth
: nth element of a lists.max
: maximum value of a lists.min
: minimum value of a lists.sort
: sort lists.list
: check whether an argument is a list.suffix
: suffixes of a list.prefix
: prefixes of a list.sublist
: sublists of a list.difference
: difference of sets.intersection
: intersection of sets.union
: union of sets.
Java Sets
Java Sets can be manipulated in Jason by some internal actions (these sets are represented by a variable). Example:.set.create(S); // S = {} .set.add(S,a); // S = {a} .set.add_all(S,[5,b,p(2),a]); // S = {5,a,b,p(2)} .set.remove(S,b); // S = {5,a,p(2)} .set.union(S,[a,1]); // S = {1,5,a,p(2)} .length(S,X); // X = 4 .type(S,T); // T = set .set.difference(S,[1,a]); // S = {5,p(2)} .findall(K, .member(K,S), LL) // LL = [5,p(2)] .set.add(S,5); .set.intersection(S,V); // S = {5} for ( .member(V,S) ) { // iteration .print(K,V); }. .set.clear(S); // S = {}Java Queues
Java Queues can be manipulated in Jason by some internal actions (these queues are represented by a variable). Example:.queue.create(Q); // Q = [] .queue.add(Q,a); // Q = [a] .queue.add(Q,b); // Q = [a, b] .queue.add_all(Q,[c,d,e]); // Q = [a, b, c, d, e] .queue.head(Q,H); // H = a .queue.remove(Q,H); // H = a, Q = [b, c, d, e] .length(Q,X); // X = 4 .type(Q,T); // T = queue for ( .member(V,Q) ) { // iteration .print(V); }. .queue.clear(Q); .queue.create(Q,priority); // Q = [] queue with priority (the queue is kept sorted) .queue.add(Q,d); // Q = [d] .queue.add(Q,c); // Q = [c, d] .queue.add_all(Q,[b,d,a]); // Q = [a, b, c, d, e] .queue.head(Q,H); // H = aJava Maps
Java Maps can be manipulated in Jason by some internal actions (these maps are represented by a variable). Example:.map.create(M); // M = {} .map.put(M,a,10); // M = {a->10} .map.put(M,b,ok); // M = {a->10, b->ok} .map.put(M,a,20); // M = {a->20, b->ok} .length(M,X); // X = 2 .type(M,T); // T = map .map.key(M,a) // true .map.key(M,V) // unifies V with all keys of M .map.value(M,10) // true .map.value(M,V) // unifies V with all values of M .findall(K, .map.key(M,K), LL) // LL = [a,b] .findall(V, .map.value(M,V), LL) // LL = [20,ok] .findall([K,V], .map.key(M,K) & .map.get(M,K,V), LL) // LL = [[a,30],[d,ok(3)]] .map.get(M,a,V); // V = 20 .map.get(M,c,V); // fail .map.get(M,c,V,0); // V = 0 .map.remove(M,a,V); // M = {b->ok} V = 20 for ( .map.key(M,K) & .map.get(M,K,V) ) { // iteration .print(K,V); }. .map.clear(M); // M = {}
String
length
: size of strings.concat
: append strings.delete
: delete characters of a string.reverse
: reverse strings.nth
: nth element of a string.substring
: test substrings of strings.string
: check whether an argument is a string.suffix
: suffixes of a string.prefix
: prefixes of a string.term2string
: convert terms to strings and vice-versa.lower_case
: lower case strings.upper_case
: upper case strings.replace
: replace strings.
Execution control
Meta programming
atom
: check whether an argument is an atom (p).structure
: check whether an argument is a structure (p(t1,t2), [a,b]).literal
: check whether an argument is a literal (p(t1,t2), ~p(t1,t2), p(t1,t2)[a1,a2]).list
: check whether an argument is a list ([a,b]).ground
: check whether an argument is ground.number
: check whether an argument is a number (1, 2.3).string
: check whether an argument is a string ("s").type
: gets the type of a term.add_nested_source
: add a source in a literal.eval
: evaluates a logical expression.
Miscellaneous
at
: add a future event.wait
: wait some event.create_agent
: create a new agent.save_agent
: store the beliefs and plans into a file.create_agent
: create a new agent.kill_agent
: kill an agent.clone
: clone an agent.stopMAS
: stop all agents.version
: gets the Jason version.date
: get the current date.time
: get the current time.fail
: an action that always fails.perceive
: force perception.range
: backtrack values in a range (used in for).random
: produces random numbers.math.set_random_seed
: sets the seed of Jason's random number generator.include
: imports a source code at run time.printf
: formated print.
-
Class Summary Class Description abolish Internal action:.abolish
.add_annot Internal action:.add_annot
.add_nested_source Internal action:.add_nested_source
.add_plan Internal action:.add_plan
.all_names Internal action:.all_names
.asserta Internal action:.asserta
.assertz Internal action:.assertz
.at Internal action:.at
.atom Internal action:.atom
.belief Internal action:.belief(Bel)
.broadcast Internal action:.broadcast
.clone concat Internal action:.concat
.copy_term count Internal action:.count
.create_agent Internal action:.create_agent
.current_intention Internal action:.current_intention
.date Internal action:.date(YY,MM,DD)
.delete Internal action:.delete
.desire Internal action:.desire(D, [ I ])
.df_deregister Internal action:.df_deregister(S [,T])
.df_register Internal action:.df_register(S [,T])
.df_search Internal action:.df_search(S [,T] , L)
.df_subscribe Internal action:.df_subscribe(S [,T])
.difference Internal action:.difference(S1,S2,S3)
.done drop_all_desires Internal action:.drop_all_desires
.drop_all_events Internal action:.drop_all_events
.drop_all_intentions Internal action:.drop_all_intentions
.drop_desire Internal action:.drop_desire(D)
.drop_event Internal action:.drop_event(D)
.drop_future_intention Internal action:.drop_future_intention(I)
.drop_intention Internal action:.drop_intention(I)
.empty Internal action:.empty
.eval Internal action:.eval(Var,Logical Expression)
.fail Internal action:.fail
.fail_goal Internal action:.fail_goal(G)
.findall Internal action:.findall(Term,Query,List)
.foreach Internal action:.for(formula) { plan_body }
.fork Implementation of .fork (used for |& and || operators).get_src_info used by test libground Internal action:.ground
.if_then_else Implementation of if.include Internal action:.include
.intend Internal action:.intend(G, [ I ] )
.intention Internal action:.intention( ID, STATE, STACK, [current])
.internal_action Internal action:.internal_action
.intersection Internal action:.intersection(S1,S2,S3)
.join injected by .forkkill_agent Internal action:.kill_agent
.length Internal action:.length
.list Internal action:.list
.list_files Internal action:.list_files
.list_plans Internal action:.list_plans
.list_rules Internal action:.list_rules
.literal Internal action:.literal
.log Internal action:.log(level, args...)
.loop Implementation of while.lower_case Internal action:.lower_case(S1,S2)
.max Internal action:.max
.member Internal action:.member(T,L)
.min Internal action:.min
.my_name Internal action:.my_name
.namespace Internal action:.namespace
.nano_time Internal action:.nano_time
.nth Internal action:.nth
.number Internal action:.number
.perceive Internal action:.perceive
.plan_label Internal action:.plan_label(P,L)
.prefix Internal action:.prefix(P,L)
.print Internal action:.print
.printf Internal action:.printf(format, args...)
.println Internal action:.println
.puts Internal action:.puts
.random Internal action:.random(N)
.range Internal action:.range(Var,Start,End, Step)
.relevant_plan Internal action:.relevant_plan
.relevant_plans Internal action:.relevant_plans
.relevant_rules Internal action:.relevant_rules
.remove_plan Internal action:.remove_plan
.remove_source_annot rename_apart replace the variable by unused named, to avoid clash.replace Internal action:.replace(S1,S2,S3,S4)
.resume Internal action:.resume(G)
.reverse Internal action:.reverse
.save_agent Internal action:.save_agent
.send Internal action:.send
.set_random_seed Internal action:.set_random_seed(N)
.setof Internal action:.setof(Term,Query,List)
.shuffle Internal action:.shuffle(List,Result)
.signal Internal action:.signal
.sort Internal action:.sort
.stopMAS Internal action:.stopMAS
.string Internal action:.string
.structure Internal action:.structure
.sublist Internal action:.sublist(S,L)
.substring Internal action:.substring
.succeed_goal Internal action:.succeed_goal(G)
.suffix Internal action:.suffix(S,L)
.suspend Internal action:.suspend(G)
.suspended Internal action:.suspended(G, R)
.term2string Internal action:.term2string(T,S)
.time Internal action:.time(HH,MM,SS,MS)
.type Internal action:.type
.union Internal action:.union(S1,S2,S3)
.upper_case Internal action:.upper_case(S1,S2)
.verbose Internal action:.verbose
.version Internal action:.version(V)
.wait Internal action:.wait(E,T)
. -
Enum Summary Enum Description desire.Step -
Annotation Types Summary Annotation Type Description Manual Manual for internal actions