Changeset 143 for ION/trunk/Lirec/src
- Timestamp:
- 10/09/2009 02:39:38 PM (11 years ago)
- Location:
- ION/trunk/Lirec/src/lirec
- Files:
-
- 3 added
- 44 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 1 28 package lirec.architecture; 29 30 import java.io.File; 31 import java.lang.reflect.Constructor; 32 import java.util.ArrayList; 33 import java.util.StringTokenizer; 34 35 import javax.xml.parsers.DocumentBuilder; 36 import javax.xml.parsers.DocumentBuilderFactory; 37 38 import org.w3c.dom.Document; 39 import org.w3c.dom.NamedNodeMap; 40 import org.w3c.dom.Node; 41 import org.w3c.dom.NodeList; 2 42 3 43 import ion.Meta.Element; … … 5 45 import lirec.level2.CompetencyExecution; 6 46 import lirec.level2.CompetencyLibrary; 7 import lirec.level3.AgentMindConnector;8 47 import lirec.level3.CompetencyManager; 9 import lirec.level3.fatima.FAtiMAConnector;10 48 import lirec.storage.LirecStorageContainer; 11 49 import lirec.storage.WorldModel; … … 16 54 * architecture components */ 17 55 public class Architecture { 18 19 // components below 20 56 21 57 /** the world model in which we store high level symbolic information */ 22 58 private WorldModel worldModel; … … 31 67 /** the competency manager */ 32 68 private CompetencyManager competencyManager; 33 34 /** the interface to the agent mind */35 private AgentMindConnector agentMindConnector;36 69 37 70 /** the competency library */ 38 71 private CompetencyLibrary competencyLibrary; 39 72 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 40 83 /** 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 43 94 // 1: create data storage components: Worldmodel and Blackboard 44 95 worldModel = new WorldModel("WorldModel",this); … … 51 102 52 103 // 2: create Competency Library, which will in turn create all competencies 53 competencyLibrary = new CompetencyLibrary(this );104 competencyLibrary = new CompetencyLibrary(this, competencyLibraryFile); 54 105 Simulation.instance.getElements().add(competencyLibrary); 55 106 Simulation.instance.update(); … … 61 112 62 113 // 4: create a competency manager 63 competencyManager = new CompetencyManager(this );114 competencyManager = new CompetencyManager(this, competencyManagerRuleFile); 64 115 Simulation.instance.getElements().add(competencyManager); 65 116 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 75 118 // now register handlers for all Lirec Components 76 119 for (Element element : Simulation.instance.getElements()) … … 81 124 } 82 125 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 83 227 /** function that updates the ion simulation regularly*/ 84 228 private void runSimulation() 85 229 { 86 230 System.out.println("Lirec Architecture running"); 231 232 // first start the competencies that are constantly running in the background 233 competencyLibrary.startBackgroundCompetencies(); 87 234 88 235 // run the ion simulation in an endless loop … … 122 269 } 123 270 124 /** returns the agent mind connector component */125 public AgentMindConnector getAgentMindConnector()126 {127 return agentMindConnector;128 }129 130 271 /** returns the competency library component */ 131 272 public CompetencyLibrary getCompetencyLibrary() … … 137 278 public static void main(String[] args) 138 279 { 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 144 298 } 145 299 -
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 1 28 package lirec.architecture; 2 29 -
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 1 28 package lirec.level2; 2 29 … … 133 160 } 134 161 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 */ 136 164 @Override 137 public finalvoid registerHandlers() {165 public void registerHandlers() { 138 166 // register request handler for start competency requests with this 139 167 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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 3 30 import ion.Meta.Simulation; 4 31 32 import java.io.File; 33 import java.lang.reflect.Constructor; 5 34 import java.util.ArrayList; 35 import java.util.HashMap; 36 import java.util.StringTokenizer; 37 38 import javax.xml.parsers.DocumentBuilder; 39 import javax.xml.parsers.DocumentBuilderFactory; 40 41 import org.w3c.dom.Document; 42 import org.w3c.dom.NamedNodeMap; 43 import org.w3c.dom.Node; 44 import org.w3c.dom.NodeList; 6 45 7 46 import lirec.architecture.Architecture; 8 47 import 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;15 48 16 49 /** the competency library is the component that registers all components */ 17 50 public class CompetencyLibrary extends LirecComponent { 18 51 19 /** the list of competencies that are available */ 52 /** the list of competencies that are available for execution by the competency 53 * execution system */ 20 54 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; 21 59 22 60 /** Create a new competency library */ 23 public CompetencyLibrary(Architecture architecture )61 public CompetencyLibrary(Architecture architecture, String competencyLibraryFile) throws Exception 24 62 { 25 63 super(architecture); … … 28 66 competencies = new ArrayList<Competency>(); 29 67 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 40 76 for (Competency competency : competencies) 41 77 { … … 43 79 competency.initialize(); 44 80 } 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 45 181 } 46 182 … … 50 186 // the competency library needs no handlers at the moment 51 187 } 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 52 196 53 197 /** return a List of competencies with the given type, the list will be empty … … 63 207 } 64 208 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 65 255 66 256 -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 3 public class RemoteCompetency { 30 import java.util.HashMap; 31 32 import 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). */ 39 public 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 4 112 5 113 } -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2; 2 29 -
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 1 28 package lirec.level2.competencies; 2 29 -
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 1 28 package lirec.level2.competencies.test; 2 29 -
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 1 28 package lirec.level2.competencies.test; 2 29 -
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 1 28 package lirec.level2.competencies.test; 2 29 -
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 1 28 package lirec.level2.competencies.test; 2 29 -
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 1 28 package lirec.level2.competencies.test; 2 29 … … 9 36 { 10 37 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) 13 47 { 14 48 // call parent class constructor, always do this first 15 49 super(architecture); 50 51 this.someParameter1 = someParameter1; 52 this.someParameter2 = someParameter2; 16 53 17 54 competencyName = "TestCompetency5"; … … 37 74 System.out.println(" "+ parameter + " = " + parameters.get(parameter)); 38 75 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 39 81 // test competency 5 always succeeds 40 82 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 1 28 package lirec.level3; 2 29 -
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 1 28 package lirec.level3; 2 29 … … 42 69 43 70 44 public CompetencyManager(Architecture architecture )71 public CompetencyManager(Architecture architecture, String competencyManagerRulesFileName) throws Exception 45 72 { 46 73 super(architecture); … … 48 75 plansCurrentlyExecuted = new HashMap<CompetencyExecutionPlan, MindAction>(); 49 76 rulesAlreadyTried = new HashMap<MindAction, ArrayList<CompetencyManagerRule>>(); 50 loadRules( );77 loadRules(competencyManagerRulesFileName); 51 78 } 52 79 … … 135 162 136 163 /** 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++) 141 182 { 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 } 166 185 } 167 186 -
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 1 28 package lirec.level3; 2 29 -
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 1 28 package lirec.level3; 2 29 -
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 1 28 package lirec.level3; 2 29 -
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 1 28 package lirec.level3; 2 29 import 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 1 28 package lirec.level3; 2 29 -
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 1 28 package lirec.level3; 2 29 -
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 1 28 package lirec.level3.fatima; 2 29 -
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 1 28 package lirec.level3.fatima; 2 29 -
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 1 28 package lirec.level3.fatima; 2 29 -
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 1 28 package lirec.level3.supersimplemind; 2 29 -
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 1 28 package lirec.level3.supersimplemind; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
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 1 28 package lirec.storage; 2 29 -
ION/trunk/Lirec/src/lirec/util/SocketListener.java
r136 r143 1 /* *1 /* 2 2 * SocketListener class, taken from FAtiMA source code, original credits below: 3 3 *
Note: See TracChangeset
for help on using the changeset viewer.