Magentix2  2.1.1
es.upv.dsic.gti_ia.jason.conversationsFactory.protocolInternalAction Class Reference
Inheritance diagram for es.upv.dsic.gti_ia.jason.conversationsFactory.protocolInternalAction:
Collaboration diagram for es.upv.dsic.gti_ia.jason.conversationsFactory.protocolInternalAction:

List of all members.

Public Member Functions

boolean suspendIntention ()
boolean canBeUsedInContext ()
String getAtomAsString (Term term)
String getTermAsString (Term term)
int getTermAsInt (Term term)
long getTermAslong (Term term)
double getTermAsdouble (Term term)
List< String > getTermAsStringList (Term term)
List< Integer > getTermAsintList (Term term)
List< Double > getTermAsdoubleList (Term term)
Literal getTermAsLiteral (Term term)

Public Attributes

HashMap< String, ConversationconversationsList = new HashMap<String, Conversation>()

Protected Member Functions

String getFactoryName (String convId, String protocolstr, boolean initiator)

Protected Attributes

String protocolSteep
ConvCFactory Protocol_Factory
Hashtable< String, ConvCFactoryCFactories = new Hashtable<String, ConvCFactory>()
int timeOut = 3000
int joinTimeOut = 4000
long conversationTime
String agName
String agentConversationID

Detailed Description

This class represents an abstract internal action with the main elements of this type of action to be inherited when using conversations in Jason agents

Author:
Bexy Alfonso Espinosa

Definition at line 18 of file protocolInternalAction.java.


Member Function Documentation

Definition at line 37 of file protocolInternalAction.java.

                                                {
                return ((Atom)term).toString();
        }
String es.upv.dsic.gti_ia.jason.conversationsFactory.protocolInternalAction.getFactoryName ( String  convId,
String  protocolstr,
boolean  initiator 
) [protected]
Parameters:
convId,:Conversation Jason identifier
protocolstr,:A small string for identifying the protocol
initiator,:true if it is the initiator agent or false if it isn't
Returns:
A formatted string for the name of the factory

Definition at line 121 of file protocolInternalAction.java.

                                                                                              {
                String rol="INI";
                if (!initiator)
                        rol="PART";
                String facName = convId;
                facName = facName.replaceAll("[\\W]|^_", "");
                facName = facName +"_"+rol+"_"+protocolstr+"FACTORY" ;
                return facName;
        }

Definition at line 71 of file protocolInternalAction.java.

                                                {
                return (double) ((NumberTerm)term).solve();
        }

Definition at line 101 of file protocolInternalAction.java.

                                                          {
                double selem;
                List<Double> result = new ArrayList<Double>();
                for (Term t: (ListTerm)term) {
                        selem = (double) ((NumberTerm)t).solve();
                        result.add(selem);
                }
                return result;
        }

Definition at line 63 of file protocolInternalAction.java.

                                          {
                return (int) ((NumberTerm)term).solve();
        }

Definition at line 91 of file protocolInternalAction.java.

                                                        {
                int selem;
                List<Integer> result = new ArrayList<Integer>();
                for (Term t: (ListTerm)term) {
                        selem = (int) ((NumberTerm)t).solve();
                        result.add(selem);
                }
                return result;
        }

Definition at line 111 of file protocolInternalAction.java.

                                                  {
                return   LiteralImpl.parseLiteral( (term).toString()  );
        }

Definition at line 67 of file protocolInternalAction.java.

                                            {
                return (long) ((NumberTerm)term).solve();
        }

Definition at line 41 of file protocolInternalAction.java.

                                                {
                String result = "";
                if (term.isAtom()){

                        result = ((Atom)term).toString();
                }else
                        if (term.isString()){
                                result = ((StringTerm)term).getString();
                                //result = ((StringTerm)term).toString();
                        }else
                                if (term.isNumeric()){
                                        double  tmp =  ((NumberTerm)term).solve();
                                        result = Double.toString(tmp);
                                }else
                                        if (term.isLiteral()){
                                                result = ((LiteralImpl)term).toString();
                                        }else   {
                                                result = term.toString();
                                        }
                return result;
        }

Definition at line 75 of file protocolInternalAction.java.

                                                          {
                String selem = "" ;
                List<String> result = new ArrayList<String>();
                for (Term t: (ListTerm)term) {
                        if (t.isAtom())
                        {selem = ((Atom)t).toString();}
                        else if (t.isLiteral())
                        {selem = t.toString();}
                        else if (t.isString())
                        {selem = ((StringTermImpl)t).getString();}
                        result.add(selem);
                }
                return result;

        }

Member Data Documentation

Definition at line 27 of file protocolInternalAction.java.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables