Changeset 143


Ignore:
Timestamp:
10/09/2009 02:39:38 PM (10 years ago)
Author:
michael.kriegel
Message:
  • made loading of competencies and architecture components dynamic (not requiring code changes), instead they are specified in xml files now
  • added support for background competencies (competencies started automatically with the architecture and running all the time in the background, ideal for sensing competencies)
  • added classes for easy implementation of competencies that communicate with a remote program via tcp and an ExampleCompetency?
  • added LGPL preamble to all files
  • updated documentation to reflect all changes above
Location:
ION/trunk/Lirec
Files:
6 added
1 deleted
45 edited

Legend:

Unmodified
Added
Removed
  • ION/trunk/Lirec/src/lirec/architecture/Architecture.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.architecture; 
     29 
     30import java.io.File; 
     31import java.lang.reflect.Constructor; 
     32import java.util.ArrayList; 
     33import java.util.StringTokenizer; 
     34 
     35import javax.xml.parsers.DocumentBuilder; 
     36import javax.xml.parsers.DocumentBuilderFactory; 
     37 
     38import org.w3c.dom.Document; 
     39import org.w3c.dom.NamedNodeMap; 
     40import org.w3c.dom.Node; 
     41import org.w3c.dom.NodeList; 
    242 
    343import ion.Meta.Element; 
     
    545import lirec.level2.CompetencyExecution; 
    646import lirec.level2.CompetencyLibrary; 
    7 import lirec.level3.AgentMindConnector; 
    847import lirec.level3.CompetencyManager; 
    9 import lirec.level3.fatima.FAtiMAConnector; 
    1048import lirec.storage.LirecStorageContainer; 
    1149import lirec.storage.WorldModel; 
     
    1654 * architecture components */ 
    1755public class Architecture { 
    18          
    19         // components below 
    20          
     56                 
    2157        /** the world model in which we store high level symbolic information */ 
    2258        private WorldModel worldModel; 
     
    3167        /** the competency manager */    
    3268        private CompetencyManager competencyManager; 
    33          
    34         /** the interface to the agent mind */ 
    35         private AgentMindConnector agentMindConnector; 
    3669 
    3770        /** the competency library */    
    3871        private CompetencyLibrary competencyLibrary; 
    3972         
     73        /** the name of the rule file for the competency manager */ 
     74        private String competencyManagerRuleFile; 
     75         
     76        /** the name of the file with the competency library configuration */ 
     77        private String competencyLibraryFile; 
     78         
     79        /** This list stores all custom components that are loaded dynamically, depending on the  
     80         *  architecture configuration, i.e. the scenario*/ 
     81        private ArrayList<LirecComponent> customComponents;  
     82         
    4083        /** create a new architecture */ 
    41         public Architecture() 
    42         { 
     84        public Architecture(String architectureConfigurationFile) throws Exception 
     85        {        
     86                // initialise lists 
     87                customComponents = new ArrayList<LirecComponent>(); 
     88                 
     89                // load the configuration file (in here custom components will be built) 
     90                loadConfigFile(architectureConfigurationFile); 
     91                 
     92                // now build default components 
     93                 
    4394                // 1: create data storage components: Worldmodel and Blackboard 
    4495                worldModel = new WorldModel("WorldModel",this); 
     
    51102                 
    52103                // 2: create Competency Library, which will in turn create all competencies 
    53                 competencyLibrary = new CompetencyLibrary(this); 
     104                competencyLibrary = new CompetencyLibrary(this, competencyLibraryFile); 
    54105                Simulation.instance.getElements().add(competencyLibrary); 
    55106                Simulation.instance.update(); 
     
    61112                 
    62113                // 4: create a competency manager 
    63                 competencyManager = new CompetencyManager(this); 
     114                competencyManager = new CompetencyManager(this, competencyManagerRuleFile); 
    64115                Simulation.instance.getElements().add(competencyManager); 
    65116                Simulation.instance.update(); 
    66                  
    67                 // 5: create an agent mind connector, for a different agent mind,  
    68                 // e.g. Fatima or supersimplemind, change class name here 
    69                 agentMindConnector = new FAtiMAConnector(this); 
    70                 // alternative mind: 
    71                 // agentMindConnector = new SuperSimpleMindConnector(this); 
    72                 Simulation.instance.getElements().add(agentMindConnector);               
    73                 Simulation.instance.update(); 
    74                  
     117                                 
    75118                // now register handlers for all Lirec Components 
    76119                for (Element element : Simulation.instance.getElements()) 
     
    81124        } 
    82125         
     126        /** parses the architecture configuration file that defines what components 
     127         *  should be loaded */ 
     128        private void loadConfigFile(String architectureConfigurationFile) throws Exception 
     129        { 
     130                File configFile = new File(architectureConfigurationFile); 
     131                if (!configFile.exists())  
     132                        throw new Exception("Could not locate architecture configuration file " + architectureConfigurationFile); 
     133                 
     134                // parse the file to a dom document 
     135                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); 
     136                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); 
     137                Document doc = docBuilder.parse (configFile); 
     138 
     139                // normalize text representation 
     140                doc.getDocumentElement().normalize(); 
     141                         
     142                // read <ArchitectureConfiguration> tags 
     143                NodeList configTags = doc.getElementsByTagName("ArchitectureConfiguration");             
     144                if (configTags.getLength() != 1) throw new Exception("Error in Architecture Configuration File: xml file needs exactly 1 tag ArchitectureConfiguration"); 
     145                NamedNodeMap attribs = configTags.item(0).getAttributes(); 
     146                 
     147                // read attribute CompetencyManagerRulesFile 
     148                Node atrCompManFile = attribs.getNamedItem("CompetencyManagerRulesFile"); 
     149                if (atrCompManFile!=null)  
     150                        competencyManagerRuleFile = atrCompManFile.getNodeValue(); 
     151                else 
     152                        throw new Exception("Architecture Configuration file does not specify competency manager rules file. Attribute CompetencyManagerRulesFile not found."); 
     153 
     154                // read attribute CompetencyLibraryConfigurationFile 
     155                Node atrCompLibFile = attribs.getNamedItem("CompetencyLibraryConfigurationFile"); 
     156                if (atrCompLibFile!=null)  
     157                        competencyLibraryFile = atrCompLibFile.getNodeValue(); 
     158                else 
     159                        throw new Exception("Architecture Configuration file does not specify competency library configuration file. Attribute CompetencyLibraryConfigurationFile not found."); 
     160                 
     161                // load custom components and create them 
     162                 
     163                // search for all ArchitectureComponent tags 
     164                NodeList allChildren = configTags.item(0).getChildNodes(); 
     165                for (int i=0; i<allChildren.getLength(); i++) 
     166                { 
     167                        Node node = allChildren.item(i); 
     168                        if (node.getNodeName().equals("ArchitectureComponent")) 
     169                        { 
     170                                attribs = node.getAttributes(); 
     171                                 
     172                                // read attribute ClassName 
     173                                String className; 
     174                                Node atrClassName = attribs.getNamedItem("ClassName"); 
     175                                if (atrClassName!=null)  
     176                                        className = atrClassName.getNodeValue(); 
     177                                else 
     178                                        throw new Exception("No class name specified for an architecture component in architecture configuration file."); 
     179 
     180                                // read attribute ConstructorParameters 
     181                                String constructorParametersStr = ""; 
     182                                Node atrConstrPars = attribs.getNamedItem("ConstructorParameters"); 
     183                                if (atrConstrPars!=null) 
     184                                        constructorParametersStr= atrConstrPars.getNodeValue(); 
     185                                 
     186                                // the first parameter to the constructor is always a reference to the architecture for all lirec components 
     187                                ArrayList<Object> constructorParameters = new ArrayList<Object>(); 
     188                                constructorParameters.add(this); 
     189                                 
     190                                // di-sect constructor parameters (in the string all parameters are seperated by a comma) 
     191                                StringTokenizer st = new StringTokenizer(constructorParametersStr,","); 
     192                                while (st.hasMoreTokens()) 
     193                                { 
     194                                        String token = st.nextToken().trim(); 
     195                                        if (!token.equals("")) constructorParameters.add(token); 
     196                                } 
     197                                 
     198                                // dynamically construct custom component 
     199                                 
     200                                // obtain class  
     201                                Class<?> cls = Class.forName(className); 
     202                                 
     203                                // create array that specifies the classes of the parameters of the constructor 
     204                                ArrayList<Class<?>> constructorClasses = new ArrayList<Class<?>>(); 
     205                                for (Object o: constructorParameters) 
     206                                        constructorClasses.add(o.getClass()); 
     207                                 
     208                                // obtain the constructor  
     209                                Constructor<?> constructor = cls.getConstructor(constructorClasses.toArray(new Class[constructorClasses.size()])); 
     210                                 
     211                                // construct an instance from the constructor 
     212                                Object instance = constructor.newInstance(constructorParameters.toArray()); 
     213                                 
     214                                // check if instance is of the right type 
     215                                if (!(instance instanceof LirecComponent)) throw new Exception("Architecture component could not be built. "+ className+ " is not a subclass of LirecComponent"); 
     216                                 
     217                                // add custom component to the simulation 
     218                                customComponents.add((LirecComponent) instance); 
     219                                Simulation.instance.getElements().add((LirecComponent) instance);                
     220                                Simulation.instance.update(); 
     221                                 
     222                        } 
     223                } 
     224         
     225        } 
     226         
    83227        /** function that updates the ion simulation regularly*/ 
    84228        private void runSimulation() 
    85229        { 
    86230                System.out.println("Lirec Architecture running"); 
     231                 
     232                // first start the competencies that are constantly running in the background 
     233                competencyLibrary.startBackgroundCompetencies(); 
    87234                 
    88235                // run the ion simulation in an endless loop 
     
    122269        } 
    123270         
    124         /** returns the agent mind connector component */ 
    125         public AgentMindConnector getAgentMindConnector() 
    126         { 
    127                 return agentMindConnector; 
    128         } 
    129          
    130271        /** returns the competency library component */ 
    131272        public CompetencyLibrary getCompetencyLibrary() 
     
    137278        public static void main(String[] args) 
    138279        { 
    139                 // initialisation 
    140                 Architecture architecture = new Architecture(); 
    141                  
    142                 // run 
    143                 architecture.runSimulation();    
     280                try 
     281                { 
     282                        // initialisation 
     283                        Architecture architecture = new Architecture("ArchitectureConfiguration.xml"); 
     284 
     285                        // run 
     286                        architecture.runSimulation();    
     287 
     288                } 
     289                 
     290                // catch exception thrown during constructing the Architecture 
     291                catch (Exception e) 
     292                { 
     293                        System.err.println(e.getMessage()); 
     294                        e.printStackTrace(); 
     295                } 
     296                 
     297                         
    144298        } 
    145299         
  • ION/trunk/Lirec/src/lirec/architecture/LirecComponent.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.architecture; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/Competency.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
     
    133160        } 
    134161         
    135         /** registers request and event handlers of the competency execution system*/ 
     162        /** registers request and event handlers of the competency execution system, 
     163         *  if overridden, remember to call super.registerHandlers(); from within */ 
    136164        @Override 
    137         public final void registerHandlers() { 
     165        public void registerHandlers() { 
    138166                // register request handler for start competency requests with this 
    139167                this.getRequestHandlers().add(new HandleStartCompetency()); 
  • ION/trunk/Lirec/src/lirec/level2/CompetencyExecution.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/CompetencyExecutionPlan.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/CompetencyExecutionPlanStep.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/CompetencyLibrary.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
    330import ion.Meta.Simulation; 
    431 
     32import java.io.File; 
     33import java.lang.reflect.Constructor; 
    534import java.util.ArrayList; 
     35import java.util.HashMap; 
     36import java.util.StringTokenizer; 
     37 
     38import javax.xml.parsers.DocumentBuilder; 
     39import javax.xml.parsers.DocumentBuilderFactory; 
     40 
     41import org.w3c.dom.Document; 
     42import org.w3c.dom.NamedNodeMap; 
     43import org.w3c.dom.Node; 
     44import org.w3c.dom.NodeList; 
    645 
    746import lirec.architecture.Architecture; 
    847import lirec.architecture.LirecComponent; 
    9 import lirec.level2.competencies.ExampleCompetency; 
    10 import lirec.level2.competencies.test.TestCompetency1; 
    11 import lirec.level2.competencies.test.TestCompetency2; 
    12 import lirec.level2.competencies.test.TestCompetency3; 
    13 import lirec.level2.competencies.test.TestCompetency4; 
    14 import lirec.level2.competencies.test.TestCompetency5; 
    1548 
    1649/** the competency library is the component that registers all components */ 
    1750public class CompetencyLibrary extends LirecComponent { 
    1851 
    19         /** the list of competencies that are available */ 
     52        /** the list of competencies that are available for execution by the competency 
     53         *  execution system */ 
    2054        private ArrayList<Competency> competencies; 
     55         
     56        /** the list of competencies that should run in the background constantly, started 
     57         *  up when the architecture is started */ 
     58        private ArrayList<Competency> backgroundCompetencies; 
    2159 
    2260        /** Create a new competency library */ 
    23         public CompetencyLibrary(Architecture architecture)  
     61        public CompetencyLibrary(Architecture architecture, String competencyLibraryFile) throws Exception  
    2462        { 
    2563                super(architecture); 
     
    2866                competencies = new ArrayList<Competency>(); 
    2967                 
    30                 // at the moment competencies to load are hard coded here 
    31                 // could be more sophisticated later 
    32                 competencies.add(new ExampleCompetency(architecture)); 
    33                 competencies.add(new TestCompetency1(architecture)); 
    34                 competencies.add(new TestCompetency2(architecture)); 
    35                 competencies.add(new TestCompetency3(architecture)); 
    36                 competencies.add(new TestCompetency4(architecture)); 
    37                 competencies.add(new TestCompetency5(architecture));             
    38                  
    39                 // add all competencies to ION and initialise 
     68                // create background competencies array list 
     69                backgroundCompetencies = new ArrayList<Competency>(); 
     70                 
     71                // load competency library file (in this function competencies that are  
     72                // specified in the file, will be built 
     73                loadConfigurationFile(competencyLibraryFile);                    
     74                 
     75                // add all competencies that were loaded to ION and initialise 
    4076                for (Competency competency : competencies) 
    4177                {        
     
    4379                        competency.initialize(); 
    4480                } 
     81 
     82                // same for background competencies 
     83                for (Competency competency : backgroundCompetencies) 
     84                {        
     85                        Simulation.instance.getElements().add(competency); 
     86                        competency.initialize(); 
     87                }        
     88        } 
     89 
     90        /** load the competency library configuration file that specifies which competencies to load*/ 
     91        private void loadConfigurationFile(String competencyLibraryFile) throws Exception 
     92        { 
     93                File configFile = new File(competencyLibraryFile); 
     94                if (!configFile.exists())  
     95                        throw new Exception("Could not locate competency library configuration file " + competencyLibraryFile); 
     96                 
     97                // parse the file to a dom document 
     98                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); 
     99                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); 
     100                Document doc = docBuilder.parse (configFile); 
     101 
     102                // normalize text representation 
     103                doc.getDocumentElement().normalize(); 
     104                         
     105                // read <CompetencyLibrary> tags 
     106                NodeList libTags = doc.getElementsByTagName("CompetencyLibrary");                
     107                if (libTags.getLength() != 1) throw new Exception("Error in Competency Library Configuration File: xml file needs exactly 1 tag CompetencyLibrary"); 
     108                 
     109                // load competencies and create them 
     110                 
     111                // search for all Competency tags 
     112                NodeList allChildren = libTags.item(0).getChildNodes(); 
     113                for (int i=0; i<allChildren.getLength(); i++) 
     114                { 
     115                        Node node = allChildren.item(i); 
     116                        if (node.getNodeName().equals("Competency")) 
     117                        { 
     118                                NamedNodeMap attribs = node.getAttributes(); 
     119                                 
     120                                // read attribute ClassName 
     121                                String className; 
     122                                Node atrClassName = attribs.getNamedItem("ClassName"); 
     123                                if (atrClassName!=null)  
     124                                        className = atrClassName.getNodeValue(); 
     125                                else 
     126                                        throw new Exception("No class name specified for an architecture component in architecture configuration file."); 
     127 
     128                                // read attribute RunInBackground default: false 
     129                                boolean runInBackground = false; 
     130                                Node atrRunInBg = attribs.getNamedItem("RunInBackground"); 
     131                                if (atrRunInBg!=null) 
     132                                        if (atrRunInBg.getNodeValue().trim().equalsIgnoreCase("True")) 
     133                                                runInBackground = true; 
     134                                 
     135                                // read attribute ConstructorParameters: default none 
     136                                String constructorParametersStr = ""; 
     137                                Node atrConstrPars = attribs.getNamedItem("ConstructorParameters"); 
     138                                if (atrConstrPars!=null) 
     139                                        constructorParametersStr= atrConstrPars.getNodeValue(); 
     140                                 
     141                                // the first parameter to the constructor is always a reference to the architecture for all lirec components 
     142                                ArrayList<Object> constructorParameters = new ArrayList<Object>(); 
     143                                constructorParameters.add(architecture); 
     144                                 
     145                                // di-sect constructor parameters (in the string all parameters are seperated by a comma) 
     146                                StringTokenizer st = new StringTokenizer(constructorParametersStr,","); 
     147                                while (st.hasMoreTokens()) 
     148                                { 
     149                                        String token = st.nextToken().trim(); 
     150                                        if (!token.equals("")) constructorParameters.add(token); 
     151                                } 
     152                                 
     153                                // dynamically construct custom competency 
     154                                 
     155                                // obtain class  
     156                                Class<?> cls = Class.forName(className); 
     157                                 
     158                                // create array that specifies the classes of the parameters of the constructor 
     159                                ArrayList<Class<?>> constructorClasses = new ArrayList<Class<?>>(); 
     160                                for (Object o: constructorParameters) 
     161                                        constructorClasses.add(o.getClass()); 
     162                                 
     163                                // obtain the constructor  
     164                                Constructor<?> constructor = cls.getConstructor(constructorClasses.toArray(new Class[constructorClasses.size()])); 
     165                                 
     166                                // construct an instance from the constructor 
     167                                Object instance = constructor.newInstance(constructorParameters.toArray()); 
     168                                 
     169                                // check if instance is of the right type 
     170                                if (!(instance instanceof Competency)) throw new Exception("Competency could not be loaded because "+ className+ " is not a subclass of Competency"); 
     171                 
     172                                // add to our list of competencies 
     173                                if (runInBackground) 
     174                                        backgroundCompetencies.add((Competency)instance); 
     175                                else     
     176                                        competencies.add((Competency)instance);                  
     177                        } 
     178                } 
     179                 
     180                 
    45181        } 
    46182 
     
    50186                // the competency library needs no handlers at the moment 
    51187        } 
     188         
     189        /** in this function all competencies that are continuously running in the background are started */ 
     190        public void startBackgroundCompetencies() 
     191        { 
     192                // if we have any competencies to start do the starting in a separate thread 
     193                if (backgroundCompetencies.size()>0) new BackgroundCompetencyStarter().start();  
     194        } 
     195         
    52196         
    53197        /** return a List of competencies with the given type, the list will be empty 
     
    63207        } 
    64208         
     209        /** thread for starting the background competencies. this might look at first 
     210         *  like an over complication, but the reason for handling the starting like here 
     211         *  is that we cannot be sure when exactly the background competencies will be available, 
     212         *  e.g. if an external client program needs to connect first, that's why we  
     213         *  have to keep trying */ 
     214        private class BackgroundCompetencyStarter extends Thread 
     215        { 
     216                @Override 
     217                public void run() 
     218                { 
     219                        // create list for storing the competencies that we have already  
     220                        // started, initially empty 
     221                        ArrayList<Competency> alreadyStartedCompetencies = new ArrayList<Competency>(); 
     222                         
     223                        // initially of course not all competencies are started 
     224                        boolean allStarted = false; 
     225         
     226                        while (!allStarted) 
     227                        { 
     228                                // assume all are started 
     229                                allStarted = true; 
     230 
     231                                // iterate over background competencies, attempt to start them 
     232                                for (Competency competency : backgroundCompetencies) 
     233                                        if (!alreadyStartedCompetencies.contains(competency)) 
     234                                        { 
     235                                                // this competency is not started yet, see if we can start it now & here                                                 
     236                                                if (competency.isAvailable())  
     237                                                { 
     238                                                        // it is available, so we can start it and add it to the started competencies list 
     239                                                        // note: competency start parameters are empty, if something needs to be passed to 
     240                                                        // the competency, the constructor can be used 
     241                                                        competency.requestStartCompetency(new HashMap<String,String>()); 
     242                                                        alreadyStartedCompetencies.add(competency); 
     243                                                } 
     244                                                else allStarted = false; 
     245                                        } 
     246                        } 
     247                         
     248                        // all competencies are started: print out a message 
     249                        System.out.println("All background competencies are started"); 
     250                } 
     251        } 
     252         
     253         
     254         
    65255         
    66256 
  • ION/trunk/Lirec/src/lirec/level2/EventCompetencyExecutionPlanFailed.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/EventCompetencyExecutionPlanSucceeded.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/EventCompetencyFailed.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/EventCompetencySucceeded.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/RemoteCompetency.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
    3 public class RemoteCompetency { 
     30import java.util.HashMap; 
     31 
     32import lirec.architecture.Architecture; 
     33 
     34/** an abstract class describing a competency, whose main execution is performed remotely, 
     35 *  in a different executable (possibly on a different machine) and that we communicate 
     36 *  with over the network. This should not be subclassed directly by a competency implementation, 
     37 *  but by another abstract class that adds the details of a certain network communication  
     38 *  technology (e.g. TCP). */ 
     39public abstract class RemoteCompetency extends Competency { 
     40                 
     41                 
     42        /** during execution, this variable indicates whether the competency has finished executing */ 
     43        private boolean ready; 
     44 
     45        /** after has ready has been set,  the return value of the competency execution is read from this variable */    
     46        private boolean competencySuccess; 
     47         
     48        /** call this constructor from subclasses */ 
     49        protected RemoteCompetency(Architecture architecture)  
     50        { 
     51                super(architecture); 
     52        }        
     53 
     54        /** the code that is executed when the competency is started*/ 
     55        @Override 
     56        protected final boolean competencyCode(HashMap<String, String> parameters) { 
     57 
     58                // set ready to false 
     59                ready = false; 
     60                 
     61                // start execution 
     62                startExecution(parameters); 
     63                 
     64                // wait here until ready 
     65                while (!ready) 
     66                { 
     67                        try { 
     68                                Thread.sleep(20); 
     69                        } catch (InterruptedException e) {} 
     70                } 
     71                 
     72                return competencySuccess;                
     73        } 
     74         
     75        /** this method will be called when execution of the competency is invoked, 
     76         *  in here a command should be sent over the socket, starting the competency 
     77         *  remotely*/ 
     78        protected abstract void startExecution(HashMap<String, String> parameters); 
     79         
     80        /** this method will be called whenever a message is received from the remote  
     81         *  competency, if the message gives an indication about failure or success of 
     82         *  the remote competency than returnSuccess or returnFailure should be called 
     83         *  at the end of this method */ 
     84        protected abstract void processMessage(String message);  
     85 
     86        /** this method should not be implemented by a competency but by a direct subclass 
     87         *  e.g. Remote TCPClient competency */ 
     88        protected abstract void sendMessage(String message);     
     89         
     90        /** this should be called from the processMessage function whenever the competency has 
     91         *  returned successfully */ 
     92        protected final void returnSuccess() 
     93        { 
     94                if (this.running) 
     95                { 
     96                        competencySuccess = true; 
     97                        ready = true; 
     98                } 
     99        } 
     100 
     101        /** this should be called from the processMessage function whenever the competency has 
     102         *  returned unsuccessfully */ 
     103        protected final void returnFailure() 
     104        { 
     105                if (this.running) 
     106                { 
     107                        competencySuccess = false; 
     108                        ready = true; 
     109                } 
     110        }        
     111         
    4112 
    5113} 
  • ION/trunk/Lirec/src/lirec/level2/RequestNewCompetencyExecutionPlan.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/RequestStartCompetency.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/competencies/ExampleCompetency.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2.competencies; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/competencies/test/TestCompetency1.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2.competencies.test; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/competencies/test/TestCompetency2.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2.competencies.test; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/competencies/test/TestCompetency3.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2.competencies.test; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/competencies/test/TestCompetency4.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2.competencies.test; 
    229 
  • ION/trunk/Lirec/src/lirec/level2/competencies/test/TestCompetency5.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level2.competencies.test; 
    229 
     
    936{ 
    1037 
    11         /** constructor of the test competency */ 
    12         public TestCompetency5(Architecture architecture) 
     38        /** remember the 1st parameter that was passed to us in the constructor in this field */ 
     39        private String someParameter1; 
     40         
     41        /** remember the 2nd parameter that was passed to us in the constructor in this field */ 
     42        private String someParameter2; 
     43         
     44        /** constructor of the test competency, this one has an additional parameter, purely 
     45         *  for the purpose whether the constructor is found and the parameter passed correctly */ 
     46        public TestCompetency5(Architecture architecture, String someParameter1, String someParameter2) 
    1347        { 
    1448                // call parent class constructor, always do this first 
    1549                super(architecture); 
     50                 
     51                this.someParameter1 = someParameter1; 
     52                this.someParameter2 = someParameter2; 
    1653                 
    1754                competencyName = "TestCompetency5"; 
     
    3774                        System.out.println("  "+ parameter + " = " + parameters.get(parameter)); 
    3875                 
     76                 
     77                System.out.println("These are the 2 parameters that Test Competency 5 was constructed with: "); 
     78                System.out.println(someParameter1); 
     79                System.out.println(someParameter2); 
     80                 
    3981                // test competency 5 always succeeds 
    4082                return true; 
  • ION/trunk/Lirec/src/lirec/level3/AgentMindConnector.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/CompetencyManager.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229 
     
    4269 
    4370         
    44         public CompetencyManager(Architecture architecture) 
     71        public CompetencyManager(Architecture architecture, String competencyManagerRulesFileName) throws Exception 
    4572        { 
    4673                super(architecture); 
     
    4875                plansCurrentlyExecuted = new HashMap<CompetencyExecutionPlan, MindAction>(); 
    4976                rulesAlreadyTried = new HashMap<MindAction, ArrayList<CompetencyManagerRule>>(); 
    50                 loadRules(); 
     77                loadRules(competencyManagerRulesFileName); 
    5178        } 
    5279         
     
    135162         
    136163        /** parse the xml file that contains the competency manager rules */ 
    137         private synchronized void loadRules() 
    138         { 
    139                 File compManagerRulesFile = new File("CompManagerRules.xml"); 
    140                 try 
     164        private synchronized void loadRules(String competencyManagerRulesFileName) throws Exception 
     165        { 
     166                File compManagerRulesFile = new File(competencyManagerRulesFileName); 
     167 
     168                // check if file exists 
     169                if (! compManagerRulesFile.exists()) throw new Exception("cannot locate competency manager rules file " + competencyManagerRulesFileName ); 
     170                         
     171                // parse the file to a dom document 
     172                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); 
     173                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); 
     174                Document doc = docBuilder.parse (compManagerRulesFile); 
     175 
     176                // normalize text representation 
     177                doc.getDocumentElement().normalize(); 
     178                         
     179                // read <Rule> tags 
     180                NodeList ruleTags = doc.getElementsByTagName("Rule");            
     181                for (int i=0; i<ruleTags.getLength(); i++) 
    141182                { 
    142                         // check if file exists 
    143                         if (! compManagerRulesFile.exists()) throw new Exception("cannot locate rules file"); 
    144                          
    145                         // parse the file to a dom document 
    146                         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); 
    147                         DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); 
    148                         Document doc = docBuilder.parse (compManagerRulesFile); 
    149  
    150                         // normalize text representation 
    151                         doc.getDocumentElement().normalize(); 
    152                          
    153                         // read <Rule> tags 
    154                         NodeList ruleTags = doc.getElementsByTagName("Rule");            
    155                         for (int i=0; i<ruleTags.getLength(); i++) 
    156                         { 
    157                                 rules.add(new CompetencyManagerRule(ruleTags.item(i))); 
    158                         }                                                
    159                 } 
    160                 catch (Exception e) 
    161                 { 
    162                         System.err.println("error parsing competency manager rules file, details below"); 
    163                         System.err.println(e.getMessage()); 
    164                         System.err.println(e.getStackTrace()); 
    165                 } 
     183                        rules.add(new CompetencyManagerRule(ruleTags.item(i))); 
     184                }                                                
    166185        } 
    167186         
  • ION/trunk/Lirec/src/lirec/level3/CompetencyManagerRule.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/EventMindActionFailed.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/EventMindActionSucceeded.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/EventRemoteAction.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229import ion.Meta.Event; 
  • ION/trunk/Lirec/src/lirec/level3/MindAction.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/RequestNewMindAction.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/fatima/FAtiMAConnector.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3.fatima; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/fatima/FAtiMAListenerThread.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3.fatima; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/fatima/FAtiMAutils.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3.fatima; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/supersimplemind/SuperSimpleMind.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3.supersimplemind; 
    229 
  • ION/trunk/Lirec/src/lirec/level3/supersimplemind/SuperSimpleMindConnector.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.level3.supersimplemind; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/EventPropertyChanged.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/EventPropertyRemoved.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/EventSubContainerAdded.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/EventSubContainerRemoved.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/LirecStorageContainer.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/RequestAddSubContainer.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/RequestRemoveProperty.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/RequestRemoveSubContainer.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/RequestSetProperty.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/storage/WorldModel.java

    r136 r143  
     1/*       
     2        Lirec Architecture 
     3        Copyright(C) 2009 Heriot Watt University 
     4 
     5        This library is free software; you can redistribute it and/or 
     6        modify it under the terms of the GNU Lesser General Public 
     7        License as published by the Free Software Foundation; either 
     8        version 2.1 of the License, or (at your option) any later version. 
     9 
     10        This library is distributed in the hope that it will be useful, 
     11        but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13        Lesser General Public License for more details. 
     14 
     15        You should have received a copy of the GNU Lesser General Public 
     16        License along with this library; if not, write to the Free Software 
     17        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 
     18 
     19        Authors:  Michael Kriegel  
     20 
     21        Revision History: 
     22  --- 
     23  09/10/2009      Michael Kriegel <mk95@hw.ac.uk> 
     24  First version. 
     25  ---   
     26*/ 
     27 
    128package lirec.storage; 
    229 
  • ION/trunk/Lirec/src/lirec/util/SocketListener.java

    r136 r143  
    1 /**  
     1/*  
    22 * SocketListener class, taken from FAtiMA source code, original credits below: 
    33 *  
Note: See TracChangeset for help on using the changeset viewer.