Skip to main content
Version: 🚧 Alpha 🚧

BDI Extension

Extension: gama.extension.bdi

The BDI (Belief-Desire-Intention) extension provides operators for reasoning and planning in the GAMA environment.

Basic Constructs​

new_predicate(name) — New Predicate​

Creates a new predicate with a given name and additional properties (values, agent causing the predicate, whether it is true).

OverloadDescription
new_predicate(name)Creates a predicate with a given name
new_predicate(name, values)Adds a values map
new_predicate(name, is_true)Adds a truth value
new_predicate(name, cause_agent)Adds an agent that caused the predicate
new_predicate(name, values, is_true)Adds values and truth
new_predicate(name, values, cause_agent)Adds values and cause agent
new_predicate(name, values, is_true, cause_agent)Adds all properties

new_emotion(name) — New Emotion​

Creates a new emotion with various combinations.

OverloadDescription
new_emotion(name)Just the name
new_emotion(name, intensity)Name and intensity
new_emotion(name, intensity, about)Name, intensity, predicate it is about
new_emotion(name, about, cause_agent)Name, predicate, and cause agent
new_emotion(name, intensity, cause_agent)Name, intensity, and cause agent
new_emotion(name, intensity, about, decay)Name, intensity, about, and decay
new_emotion(name, intensity, about, cause_agent)Name, intensity, about, and cause agent
new_emotion(name, intensity, about, decay, cause_agent)All properties

new_mental_state(modality) — New Mental State​

Creates a new mental state with a given modality (bel, bel_em, des, int) and various properties.

OverloadDescription
new_mental_state(modality)Just the modality
new_mental_state(modality, predicate)Adds a predicate
new_mental_state(modality, predicate, strength)Adds strength
new_mental_state(modality, predicate, lifetime)Adds lifetime
new_mental_state(modality, predicate, cause_agent)Adds cause agent
new_mental_state(modality, predicate, strength, lifetime)Adds strength and lifetime
new_mental_state(modality, predicate, strength, cause_agent)Adds strength and cause agent
new_mental_state(modality, predicate, lifetime, cause_agent)Adds lifetime and cause agent
new_mental_state(modality, predicate, strength, lifetime, cause_agent)All properties
new_mental_state(modality, emotion)Adds an emotion about
new_mental_state(modality, emotion, strength)Adds emotion and strength
new_mental_state(modality, emotion, lifetime)Adds emotion and lifetime
new_mental_state(modality, emotion, cause_agent)Adds emotion and cause agent
new_mental_state(modality, emotion, strength, lifetime, cause_agent)All properties
new_mental_state(modality, mental_state)Adds about another mental state
new_mental_state(modality, mental_state, strength)Adds mental state and strength
new_mental_state(modality, mental_state, lifetime)Adds mental state and lifetime
new_mental_state(modality, mental_state, cause_agent)Adds mental state and cause agent
new_mental_state(modality, mental_state, strength, lifetime, cause_agent)All properties

Creates a new social link with another agent with optional parameters (appreciation/dominance/solidarity/familiarity values).

OverloadDescription
new_social_link(agent)Link to another agent
new_social_link(agent, appreciation, dominance, solidarity, familiarity)With all parameters

Predicate Operators​

OperatorDescription
predicate with_truth valueChanges the truth value of a predicate
predicate with_values mapChanges the values map of a predicate
predicate add_values mapAdds to the values map

Emotional Modifiers​

OperatorDescription
emotion with_agent_cause agentChanges the cause agent of an emotion
emotion with_intensity intensityChanges the intensity value of an emotion
emotion with_decay decayChanges the decay rate of an emotion
emotion with_about predicateChanges the predicate an emotion is about
OperatorDescription
social_link with_agent agentChanges the target agent of a social link
social_link with_liking valueChanges the liking value of a social link
social_link with_dominance valueChanges the dominance value
social_link with_solidarity valueChanges the solidarity value
social_link with_familiarity valueChanges the familiarity value
social_link with_trust valueChanges the trust value
get_agent(social_link)Returns the target agent of a social link

Logical Connectives​

OperatorDescription
p1 and p2Creates a composite predicate combining two as conjunctive subintentions
p1 or p2Creates a composite predicate combining two as disjunctive subintentions
not p1Returns a predicate with inverted truth value

Mental State Modifiers​

OperatorDescription
mental_state set_modality modeChanges the modality of a mental state
mental_state set_predicate predChanges the predicate of a mental state
mental_state set_strength strengthChanges the strength of a mental state
mental_state set_lifetime lifeChanges the lifetime of a mental state

Belief Queries​

OperatorDescription
get_beliefs_with_name_op(agent, name)Gets all beliefs whose predicate has a given name
get_belief_with_name_op(agent, name)Gets one belief whose predicate has a given name
get_belief_op(agent, predicate)Gets a belief by its exact predicate
get_beliefs_op(agent, predicate)Gets all beliefs matching a predicate
has_belief_op(agent, predicate)Checks if a belief exists for a given predicate
has_belief_with_name_op(agent, name)Checks if a belief exists with a given name

Desire Queries​

OperatorDescription
get_desires_with_name_op(agent, name)Gets all desires whose predicate has a given name
get_desire_with_name_op(agent, name)Gets one desire whose predicate has a given name
get_desire_op(agent, predicate)Gets a desire by its exact predicate
get_desires_op(agent, predicate)Gets all desires matching a predicate
has_desire_op(agent, predicate)Checks if a desire exists for a given predicate
has_desire_with_name_op(agent, name)Checks if a desire exists with a given name

Intention Queries​

OperatorDescription
get_intentions_with_name_op(agent, name)Gets all intentions whose predicate has a given name
get_intention_with_name_op(agent, name)Gets one intention whose predicate has a given name
get_intention_op(agent, predicate)Gets an intention by its exact predicate
get_intentions_op(agent, predicate)Gets all intentions matching a predicate
has_intention_op(agent, predicate)Checks if an intention exists for a given predicate
has_intention_with_name_op(agent, name)Checks if an intention exists with a given name
get_current_intention_op(agent)Gets the currently active intention of an agent

Other Base Queries​

OperatorDescription
get_plan_name(agent)Returns the name of a plan
get_uncertainties_with_name_op(agent, name)Gets all uncertainties with a given name
get_uncertainty_op(agent, predicate)Gets an uncertainty by predicate
has_uncertainty_op(agent, predicate)Checks if an uncertainty exists
get_ideals_with_name_op(agent, name)Gets all ideals with a given name
get_ideal_op(agent, predicate)Gets an ideal by predicate
has_ideal_op(agent, predicate)Checks if an ideal exists
get_obligations_with_name_op(agent, name)Gets all obligations with a given name
get_obligation_op(agent, predicate)Gets an obligation by predicate
has_obligation_op(agent, predicate)Checks if an obligation exists

Statement/Action Reference​

See SimpleBdiArchitecture for the full list of actions and variables provided by the BDI skill (e.g., add_belief, add_emotion, add_intention, add_desire, add_ideal, add_uncertainty, add_obligation, add_social_link, add_belief_emotion, comply, violate, instantiate_norm, enforce, sanction, make_law, etc.).

Plan Evaluation​

OperatorDescription
eval_when(plan)Evaluates the "when" condition (context expression) of a plan
eval_achieve(plan)Evaluates the "achieve" expression of a plan
eval_reduce(plan)Evaluates the "reduce" expression of a plan

See Also​