LightJason - AgentSpeak(L++)
CAchievementGoalLiteral.java
Go to the documentation of this file.
1
/*
2
* @cond LICENSE
3
* ######################################################################################
4
* # LGPL License #
5
* # #
6
* # This file is part of the LightJason AgentSpeak(L++) #
7
* # Copyright (c) 2015-19, LightJason (info@lightjason.org) #
8
* # This program is free software: you can redistribute it and/or modify #
9
* # it under the terms of the GNU Lesser General Public License as #
10
* # published by the Free Software Foundation, either version 3 of the #
11
* # License, or (at your option) any later version. #
12
* # #
13
* # This program is distributed in the hope that it will be useful, #
14
* # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15
* # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
16
* # GNU Lesser General Public License for more details. #
17
* # #
18
* # You should have received a copy of the GNU Lesser General Public License #
19
* # along with this program. If not, see http://www.gnu.org/licenses/ #
20
* ######################################################################################
21
* @endcond
22
*/
23
24
package
org.lightjason.agentspeak.language.execution.action.achievement_test;
25
26
import
org
.
lightjason
.
agentspeak
.
language
.
ILiteral
;
27
import
org
.
lightjason
.
agentspeak
.
language
.
ITerm
;
28
import
org
.
lightjason
.
agentspeak
.
language
.
execution
.
IContext
;
29
import
org
.
lightjason
.
agentspeak
.
language
.
fuzzy
.
IFuzzyValue
;
30
import
org
.
lightjason
.
agentspeak
.
language
.
instantiable
.
plan
.
trigger
.
CTrigger
;
31
import
org
.
lightjason
.
agentspeak
.
language
.
instantiable
.
plan
.
trigger
.
ITrigger
;
32
33
import
javax.annotation.Nonnull;
34
import
java.text.MessageFormat;
35
import
java.util.List;
36
37
41
public
final
class
CAchievementGoalLiteral
extends
IAchievementGoal
<ILiteral>
42
{
46
private
static
final
long
serialVersionUID
= -8534258655371085840L;
47
54
public
CAchievementGoalLiteral
( @Nonnull
final
ILiteral
p_type,
final
boolean
p_immediately )
55
{
56
super( p_type, p_immediately );
57
}
58
59
@Override
60
public
final
String
toString
()
61
{
62
return
MessageFormat.format(
"{0}{1}"
,
m_immediately
?
"!!"
:
"!"
, m_value );
63
}
64
65
@Nonnull
66
@Override
67
public
final
IFuzzyValue<Boolean>
execute
(
final
boolean
p_parallel, @Nonnull
final
IContext
p_context,
68
@Nonnull
final
List<ITerm> p_argument, @Nonnull
final
List<ITerm> p_return )
69
{
70
return
p_context.agent().trigger(
CTrigger
.
from
(
ITrigger
.
EType
.
ADDGOAL
, m_value.unify( p_context ) ),
m_immediately
);
71
}
72
73
}
org.lightjason.agentspeak.language.instantiable
Definition:
IBaseInstantiable.java:24
org.lightjason.agentspeak
org.lightjason.agentspeak.language.ILiteral
literal interface
Definition:
ILiteral.java:39
org.lightjason.agentspeak.language.fuzzy
Definition:
CFuzzyValue.java:24
org.lightjason.agentspeak.language.instantiable.plan.trigger.CTrigger
event with literal data
Definition:
CTrigger.java:37
org.lightjason.agentspeak.language.instantiable.plan.trigger
Definition:
CTrigger.java:24
org.lightjason.agentspeak.language.instantiable.plan.trigger.CTrigger.from
static ITrigger from( @Nonnull final EType p_event, @Nonnull final ILiteral p_literal)
creates a trigger event^
Definition:
CTrigger.java:87
org.lightjason.agentspeak.language.execution
org.lightjason.agentspeak.language.execution.action.achievement_test.IAchievementGoal
abstract achievement-goal class for goal execution
Definition:
IAchievementGoal.java:36
org.lightjason.agentspeak.language.execution.action.achievement_test.IAchievementGoal< ILiteral >::m_immediately
final boolean m_immediately
flag to run immediately
Definition:
IAchievementGoal.java:45
org.lightjason
org.lightjason.agentspeak.language
Definition:
language/CCommon.java:24
org.lightjason.agentspeak.language.execution.IContext
execution context with local data
Definition:
IContext.java:42
org.lightjason.agentspeak.language.execution.action.achievement_test.CAchievementGoalLiteral
achievement-goal action based on a literal
Definition:
CAchievementGoalLiteral.java:41
org.lightjason.agentspeak.language.instantiable.plan.trigger.ITrigger.EType.ADDGOAL
ADDGOAL
Definition:
ITrigger.java:149
org.lightjason.agentspeak.language.execution.action.achievement_test.CAchievementGoalLiteral.CAchievementGoalLiteral
CAchievementGoalLiteral( @Nonnull final ILiteral p_type, final boolean p_immediately)
ctor
Definition:
CAchievementGoalLiteral.java:54
org
org.lightjason.agentspeak.language.instantiable.plan.trigger.ITrigger.EType
event types
Definition:
ITrigger.java:145
org.lightjason.agentspeak.language.fuzzy.IFuzzyValue
result for an immutable fuzzy value
Definition:
IFuzzyValue.java:37
org.lightjason.agentspeak.language.execution.action.achievement_test.CAchievementGoalLiteral.serialVersionUID
static final long serialVersionUID
serial id
Definition:
CAchievementGoalLiteral.java:46
org.lightjason.agentspeak.language.instantiable.plan.trigger.ITrigger
event definition
Definition:
ITrigger.java:50
org.lightjason.agentspeak.language.execution.action.achievement_test.CAchievementGoalLiteral.execute
final IFuzzyValue< Boolean > execute(final boolean p_parallel, @Nonnull final IContext p_context, @Nonnull final List< ITerm > p_argument, @Nonnull final List< ITerm > p_return)
Definition:
CAchievementGoalLiteral.java:67
org.lightjason.agentspeak.language.instantiable.plan
org.lightjason.agentspeak.language.execution.action.achievement_test.CAchievementGoalLiteral.toString
final String toString()
Definition:
CAchievementGoalLiteral.java:60
org.lightjason.agentspeak.language.ITerm
term interface
Definition:
ITerm.java:36
src
main
java
org
lightjason
agentspeak
language
execution
action
achievement_test
CAchievementGoalLiteral.java
Generated by
1.8.13