You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
(35) |
Apr
(96) |
May
(39) |
Jun
(25) |
Jul
(7) |
Aug
(7) |
Sep
(44) |
Oct
(17) |
Nov
(14) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(5) |
Feb
(28) |
Mar
(26) |
Apr
(14) |
May
(3) |
Jun
(3) |
Jul
(13) |
Aug
(41) |
Sep
(12) |
Oct
|
Nov
(2) |
Dec
(17) |
2010 |
Jan
(9) |
Feb
(5) |
Mar
(11) |
Apr
(3) |
May
(4) |
Jun
(2) |
Jul
(3) |
Aug
(8) |
Sep
(2) |
Oct
(11) |
Nov
(3) |
Dec
(1) |
2011 |
Jan
|
Feb
(1) |
Mar
(8) |
Apr
(4) |
May
(4) |
Jun
(5) |
Jul
(3) |
Aug
(2) |
Sep
(7) |
Oct
(4) |
Nov
(4) |
Dec
(2) |
2012 |
Jan
|
Feb
|
Mar
(4) |
Apr
(11) |
May
(8) |
Jun
(2) |
Jul
(7) |
Aug
(6) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
(1) |
Mar
(7) |
Apr
(3) |
May
(1) |
Jun
(4) |
Jul
(8) |
Aug
(4) |
Sep
(4) |
Oct
(6) |
Nov
(8) |
Dec
(6) |
2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(10) |
Jul
|
Aug
(7) |
Sep
(15) |
Oct
(4) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
|
Feb
(1) |
Mar
(10) |
Apr
(4) |
May
(6) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(5) |
Nov
(6) |
Dec
(12) |
2016 |
Jan
(1) |
Feb
(4) |
Mar
(7) |
Apr
(30) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jom...@us...> - 2008-03-17 08:41:46
|
Revision: 1156 http://jason.svn.sourceforge.net/jason/?rev=1156&view=rev Author: jomifred Date: 2008-03-17 01:41:44 -0700 (Mon, 17 Mar 2008) Log Message: ----------- add massim-server and massim-agents in SVN instructions to run the team in readme.txt Modified Paths: -------------- trunk/applications/jason-team/AC-Local-JasonTeam.mas2j trunk/applications/jason-team/readme.txt Added Paths: ----------- trunk/applications/jason-team/massim-agents/ trunk/applications/jason-team/massim-agents/LICENSE trunk/applications/jason-team/massim-agents/README trunk/applications/jason-team/massim-agents/demoAgent.jar trunk/applications/jason-team/massim-agents/startAgents.sh trunk/applications/jason-team/massim-server/ trunk/applications/jason-team/massim-server/LICENSE trunk/applications/jason-team/massim-server/README trunk/applications/jason-team/massim-server/conf/ trunk/applications/jason-team/massim-server/conf/serverconfig.xml trunk/applications/jason-team/massim-server/conf/visualconfig.xml trunk/applications/jason-team/massim-server/lib/ trunk/applications/jason-team/massim-server/lib/batik-css.jar trunk/applications/jason-team/massim-server/lib/batik-dom.jar trunk/applications/jason-team/massim-server/lib/batik-ext.jar trunk/applications/jason-team/massim-server/lib/batik-svg-dom.jar trunk/applications/jason-team/massim-server/lib/batik-util.jar trunk/applications/jason-team/massim-server/lib/batik-xml.jar trunk/applications/jason-team/massim-server/lib/massimserver.jar trunk/applications/jason-team/massim-server/lib/serializer.jar trunk/applications/jason-team/massim-server/lib/xalan.jar trunk/applications/jason-team/massim-server/massim/ trunk/applications/jason-team/massim-server/massim/rmi/ trunk/applications/jason-team/massim-server/massim/rmi/SimulationStateServer.class trunk/applications/jason-team/massim-server/massim/rmi/SimulationStateServerObserver$SimulationStateServerImplementation.class trunk/applications/jason-team/massim-server/massim/rmi/SimulationStateServerObserver.class trunk/applications/jason-team/massim-server/massim/rmi/StringMapServer.class trunk/applications/jason-team/massim-server/massim/rmi/XMLDocumentObserver$XMLDocumentServerImplementation.class trunk/applications/jason-team/massim-server/massim/rmi/XMLDocumentObserver.class trunk/applications/jason-team/massim-server/massim/rmi/XMLDocumentServer.class trunk/applications/jason-team/massim-server/output/ trunk/applications/jason-team/massim-server/startServer.sh Modified: trunk/applications/jason-team/AC-Local-JasonTeam.mas2j =================================================================== --- trunk/applications/jason-team/AC-Local-JasonTeam.mas2j 2008-03-16 17:44:47 UTC (rev 1155) +++ trunk/applications/jason-team/AC-Local-JasonTeam.mas2j 2008-03-17 08:41:44 UTC (rev 1156) @@ -11,7 +11,7 @@ agents: dummy1 dummy.asl - [verbose=1, gui=no, write_model=no, ac_sim_back_dir="/Users/jomi/bin/massim-server/backup", + [verbose=1, gui=no, write_model=no, ac_sim_back_dir="./massim-server/backup", host="localhost", port=12300, username=participant1, password="1"] agentArchClass arch.ACArchitecture agentClass agent.SelectEvent Added: trunk/applications/jason-team/massim-agents/LICENSE =================================================================== --- trunk/applications/jason-team/massim-agents/LICENSE (rev 0) +++ trunk/applications/jason-team/massim-agents/LICENSE 2008-03-17 08:41:44 UTC (rev 1156) @@ -0,0 +1,353 @@ +############################################################### +# Multi-Agent Programming Contest 2008 # +# # +# Support package massim-agents # +# LICENSE file for tha massim-agents pakage # +# # +# For the details on the contest, check the Contest website: # +# http://cig.in.tu-clausthal.de/agentcontest2008/ # +# # +# Organizers: # +# J. Dix, M. Dastani, P. Novak, T.M. Behrens # +############################################################### + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file Added: trunk/applications/jason-team/massim-agents/README =================================================================== --- trunk/applications/jason-team/massim-agents/README (rev 0) +++ trunk/applications/jason-team/massim-agents/README 2008-03-17 08:41:44 UTC (rev 1156) @@ -0,0 +1,61 @@ +############################################################### +# Multi-Agent Programming Contest 2008 # +# # +# Support package MASSim server # +# README file for the MASSim server package # +# # +# For the details on the contest, check the Contest website: # +# http://cig.in.tu-clausthal.de/agentcontest2008/ # +# # +# Organizers: # +# J. Dix, M. Dastani, P. Novak, T.M. Behrens # +############################################################### + +1. Prerequisites. + +You only need the sun-java5 / sun-java6 (jre and jdk) installed to run the server. + +2. Installing and running. + +·Unpack the file anywhere: + tar xzvf massim-Server-version.tag.gz -C output_dir + +·Switch to the new directory: + cd output_dir/massim-Server + +·Run the script provided in the package: + ./startServer + +3. Options. + +You can edit the startServer script for changing the ip where the rmi registry + will be run (variable name), or the location of configuration file: + +4. Configuration files +4.1 Server configuration + +The serverconfig.xml file is located inside the conf directory. There you can +specify all the parameters refered to the simulation: from the number of agents +to the map style. + +The first relevant element is the configuration one. It contains attributes like +the grid's size, number of elements (agents, gold items, obstacles) inside the +grid and some probability parameters. + +If no more is specified a random map will be created using the parameters provided. + +There is also the capability of creating your map, placing all the elements in their +position. + +The easiest way is read the second simulation config from the serverconfig.xml fіle +and understand the array elements. + +4.2 Visualization configuration +The visualconfig.xml file is also located inside the conf directory. There you can +specify parameters refered to the visualization (or svg output files). It allows you +change the colors and sizes of the elements. + +5. Questions, problems, suggestions, ... + +please, ask to the Agent Contest 2008 mail-list agentcontest2008-general [at] in.tu-clausthal.de +and for more fast communication: jens.dehnert [at] tu-clausthal.de or slawomir.deren [at] tu-clausthal.de \ No newline at end of file Added: trunk/applications/jason-team/massim-agents/demoAgent.jar =================================================================== (Binary files differ) Property changes on: trunk/applications/jason-team/massim-agents/demoAgent.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/applications/jason-team/massim-agents/startAgents.sh =================================================================== --- trunk/applications/jason-team/massim-agents/startAgents.sh (rev 0) +++ trunk/applications/jason-team/massim-agents/startAgents.sh 2008-03-17 08:41:44 UTC (rev 1156) @@ -0,0 +1,33 @@ +############################################################### +#!/bin/sh # +############################################################### +# Multi-Agent Programming Contest 2008 # +# # +# Support package massim-demoAgents # +# This script starts the 6 agents for 2 teams. They connect # +# to a massim-Server running in the same host and with the # +# username and passwords specified. For more information # +# refer to the README file. # +# # +# For the details on the contest, check the Contest website: # +# http://cig.in.tu-clausthal.de/agentcontest2008/ # +# # +# Organizers: # +# J. Dix, M. Dastani, P. Novak, T.M. Behrens # +############################################################### + +server=localhost + +echo "Launching Agents" +java -jar demoAgent.jar botagent1 1 $server & +java -jar demoAgent.jar botagent2 2 $server & +java -jar demoAgent.jar botagent3 3 $server & +java -jar demoAgent.jar botagent4 4 $server & +java -jar demoAgent.jar botagent5 5 $server & +java -jar demoAgent.jar botagent6 6 $server & +#java -jar demoAgent.jar participant1 1 $server & +#java -jar demoAgent.jar participant2 2 $server & +#java -jar demoAgent.jar participant3 3 $server & +#java -jar demoAgent.jar participant4 4 $server & +#java -jar demoAgent.jar participant5 5 $server & +#java -jar demoAgent.jar participant6 6 $server & Property changes on: trunk/applications/jason-team/massim-agents/startAgents.sh ___________________________________________________________________ Name: svn:executable + * Added: trunk/applications/jason-team/massim-server/LICENSE =================================================================== --- trunk/applications/jason-team/massim-server/LICENSE (rev 0) +++ trunk/applications/jason-team/massim-server/LICENSE 2008-03-17 08:41:44 UTC (rev 1156) @@ -0,0 +1,353 @@ +############################################################### +# Multi-Agent Programming Contest 2008 # +# # +# Support package massim-server # +# LICENSE file for the massim-server package # +# # +# For the details on the contest, check the Contest website: # +# http://cig.in.tu-clausthal.de/agentcontest2008/ # +# # +# Organizers: # +# J. Dix, M. Dastani, P. Novak, T.M. Behrens # +############################################################### + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file Added: trunk/applications/jason-team/massim-server/README =================================================================== --- trunk/applications/jason-team/massim-server/README (rev 0) +++ trunk/applications/jason-team/massim-server/README 2008-03-17 08:41:44 UTC (rev 1156) @@ -0,0 +1,61 @@ +############################################################### +# Multi-Agent Programming Contest 2008 # +# # +# Support package MASSim server # +# README file for the MASSim server package # +# # +# For the details on the contest, check the Contest website: # +# http://cig.in.tu-clausthal.de/agentcontest2008/ # +# # +# Organizers: # +# J. Dix, M. Dastani, P. Novak, T.M. Behrens # +############################################################### + +1. Prerequisites. + +You only need the sun-java5 / sun-java6 (jre and jdk) installed to run the server. + +2. Installing and running. + +·Unpack the file anywhere: + tar xzvf massim-Server-version.tag.gz -C output_dir + +·Switch to the new directory: + cd output_dir/massim-Server + +·Run the script provided in the package: + ./startServer + +3. Options. + +You can edit the startServer script for changing the ip where the rmi registry + will be run (variable name), or the location of configuration file: + +4. Configuration files +4.1 Server configuration + +The serverconfig.xml file is located inside the conf directory. There you can +specify all the parameters refered to the simulation: from the number of agents +to the map style. + +The first relevant element is the configuration one. It contains attributes like +the grid's size, number of elements (agents, gold items, obstacles) inside the +grid and some probability parameters. + +If no more is specified a random map will be created using the parameters provided. + +There is also the capability of creating your map, placing all the elements in their +position. + +The easiest way is read the second simulation config from the serverconfig.xml fіle +and understand the array elements. + +4.2 Visualization configuration +The visualconfig.xml file is also located inside the conf directory. There you can +specify parameters refered to the visualization (or svg output files). It allows you +change the colors and sizes of the elements. + +5. Questions, problems, suggestions, ... + +please, ask to the Agent Contest 2008 mail-list agentcontest2008-general [at] in.tu-clausthal.de +and for more fast communication: jens.dehnert [at] tu-clausthal.de or slawomir.deren [at] tu-clausthal.de \ No newline at end of file Added: trunk/applications/jason-team/massim-server/conf/serverconfig.xml =================================================================== --- trunk/applications/jason-team/massim-server/conf/serverconfig.xml (rev 0) +++ trunk/applications/jason-team/massim-server/conf/serverconfig.xml 2008-03-17 08:41:44 UTC (rev 1156) @@ -0,0 +1,241 @@ +<?xml version="1.0" encoding="utf-8"?> +<conf tournamentname="GridSimulation" tournamentmode="0" launch-sync-type="key" time-to-launch="10000" reportpath="." backuppath="backup"> + <network-agent port="12300" backlog="10"/> + <match> + <simulation + id="WildWildWest" + simulationclass="massim.simulation.GridSimulation" + configurationclass="massim.simulation.GridSimulationConfigurationHandCrafted" + rmiobserver="massim.simulation.GridSimulationRMIObserver" + xmlobserver="massim.simulation.GridSimulationXMLObserver" + rmixmlobserver="massim.simulation.GridSimulationRMIXMLDocumentObserver" + xmlobserverpath="." + xmlstatisticsobserver="massim.simulation.GridSimulationXMLStatisticsObserver" + file-simulationlog="./log" + visualisationobserver="massim.simulation.GridSimulationVisualizationObserver" + > + + <configuration + xmlns:meta="http://www.tu-clausthal.de/" + sizex="70" + sizey="70" + maxNumberOfSteps="500" + + numberOfAgents="12" + numberOfObstacles="200" + numberOfCows="100" + + cowSpeed="1" + agentSpeed="1" + + lineOfSight="17" + + fearRange="4" + attractionRange="5" + cowWeight="5" + agentWeight="-200" + emptyWeight="1" + obstacleWeight="-1" + + htaccess = "1" + + > + + <array item0="35" item1="35" item2="35" item3="35" item4="35" item5="35" item6="35" item7="35" item8="35" item9="35" item10="35" item11="35" meta:length="12" meta:name="agentPositionY" /> + <array item0="6" item1="8" item2="10" item3="12" item4="14" item5="16" item6="63" item7="61" item8="59" item9="57" item10="55" item11="53" meta:length="12" meta:name="agentPositionX"/> + + + <array + + item0="25" item1="28" item2="22" item3="21" item4="26" item5="25" item6="27" item7="22" item8="24" item9="23" + + item10="45" item11="48" item12="42" item13="41" item14="46" item15="45" item16="47" item17="42" item18="44" item19="43" + + + + item20="62" item21="63" item22="58" item23="68" item24="63" item25="66" item26="60" item27="61" item28="67" item29="59" + + item30="7" item31="6" item32="11" item33="1" item34="6" item35="3" item36="9" item37="8" item38="2" item39="10" + + item40="39" item41="42" item42="41" item43="38" item44="37" item45="40" item46="39" item47="37" item48="44" item49="36" + + item50="39" item51="42" item52="41" item53="38" item54="37" item55="40" item56="39" item57="37" item58="44" item59="36" + + item60="5" item61="6" item62="13" item63="4" item64="3" item65="5" item66="8" item67="7" item68="5" item69="1" + + + item70="62" item71="65" item72="59" item73="65" item74="68" item75="61" item76="62" item77="63" item78="69" item79="58" + + + + item90="23" item91="21" item92="28" item93="28" item94="26" item95="23" item96="29" item97="28" item98="22" item99="29" + + item80="28" item81="29" item82="24" item83="33" item84="31" item85="28" item86="34" item87="33" item88="27" item89="26" + + meta:length="100" meta:name="cowPositionY"/> + + + <array + + item0="32" item1="33" item2="34" item3="35" item4="36" item5="37" item6="38" item7="39" item8="31" item9="35" + + item10="32" item11="33" item12="34" item13="35" item14="36" item15="37" item16="38" item17="39" item18="31" item19="35" + + + + item20="30" item21="27" item22="28" item23="31" item24="32" item25="29" item26="30" item27="32" item28="25" item29="33" + + item30="39" item31="42" item32="41" item33="38" item34="37" item35="40" item36="39" item37="37" item38="44" item39="36" + + item40="7" item41="6" item42="11" item43="7" item44="6" item45="5" item46="9" item47="8" item48="8" item49="10" + + item50="58" item51="59" item52="54" item53="53" item54="59" item55="61" item56="55" item57="56" item58="52" item59="54" + + item60="7" item61="6" item62="11" item63="1" item64="6" item65="3" item66="9" item67="8" item68="2" item69="10" + + item70="63" item71="64" item72="58" item73="68" item74="66" item75="63" item76="69" item77="68" item78="62" item79="59" + + item80="13" item81="11" item82="18" item83="18" item84="16" item85="13" item86="19" item87="18" item88="12" item89="19" + item90="58" item91="59" item92="53" item93="63" item94="61" item95="58" item96="64" item97="63" item98="57" item99="54" + + meta:length="100" meta:name="cowPositionX"/> + + <array item0="0" item1="14" meta:length="2" meta:name="stable1X"/> + <array item0="55" item1="69" meta:length="2" meta:name="stable1Y"/> + <array item0="55" item1="69" meta:length="2" meta:name="stable2X"/> + <array item0="0" item1="14" meta:length="2" meta:name="stable2Y"/> + + + + <array + + + item0="29" item1="29" item2="29" item3="29" item4="29" item5="29" item6="29" item7="29" item8="29" item9="29" item10="29" + + + item11="15" item12="15" item13="15" item14="15" item15="15" item16="15" item17="15" item18="15" item19="15" item20="15" item21="15" item22="15" item23="15" item24="15" item25="15" + + item26="54" item27="54" item28="54" item29="54" item30="54" item31="54" item32="54" item33="54" item34="54" item35="54" item36="54" item37="54" item38="54" item39="54" item40="54" + + + + item41="40" item42="40" item43="40" item44="40" item45="40" item46="40" item47="40" item48="40" item49="40" item50="40" item51="40" + + + item52="29" item53="29" item54="29" item55="29" item56="29" item57="29" item58="29" item59="29" item60="29" item61="29" item62="29" + + + item63="40" item64="40" item65="40" item66="40" item67="40" item68="40" item69="40" item70="40" item71="40" item72="40" item73="40" + + item74="49" item75="48" item76="47" item77="46" item78="45" item79="44" item80="43" item81="42" item82="41" + item83="54" item89="53" item90="52" item91="51" item92="50" item84="69" item85="68" item86="67" item87="66" item88="65" + + item93="20" item94="21" item95="22" item96="23" item97="24" item98="25" item99="26" item100="27" item101="28" + item102="15" item103="16" item104="17" item105="18" item106="19" item107="0" item108="1" item109="2" item110="3" item111="4" + + + item112="4" item113="4" item114="4" item115="3" item116="3" item117="2" item118="2" item119="1" item120="1" item121="0" item122="0" + item123="0" item124="1" item125="2" item126="3" + + + item127="65" item128="65" item129="65" item130="66" item131="66" item132="67" item133="67" item134="68" item135="68" item136="69" item137="69" + item138="69" item139="68" item140="67" item141="66" + + item142="15" item143="16" item144="17" item145="18" item146="19" item147="20" item148="21" item149="22" item150="23" item151="24" item152="25" item153="26" item154="27" item155="28" item156="29" + item157="22" item158="22" item159="22" item160="22" item161="22" item162="22" item163="22" item164="22" item165="22" item166="22" + + + item167="54" item168="53" item169="52" item170="51" item171="50" item172="49" item173="48" item174="47" item175="46" item176="45" item177="44" item178="43" item179="42" item180="41" item181="40" + item182="47" item183="47" item184="47" item185="47" item186="47" item187="47" item188="47" item189="47" item190="47" item191="47" + + item192="0" item193="1" item194="2" item195="3" item196="69" item197="68" item198="67" item199="66" + meta:length="200" meta:name="obstaclePositionX"/> + + + <array + + + item0="20" item1="21" item2="22" item3="23" item4="24" item5="25" item6="26" item7="27" item8="28" item9="29" item10="30" + + + + item11="55" item12="56" item13="57" item14="58" item15="59" item16="60" item17="61" item18="62" item19="63" item20="64" item21="65" item22="66" item23="67" item24="68" item25="69" + + item26="0" item27="1" item28="2" item29="3" item30="4" item31="5" item32="6" item33="7" item34="8" item35="9" item36="10" item37="11" item38="12" item39="13" item40="14" + + + item41="20" item42="21" item43="22" item44="23" item45="24" item46="25" item47="26" item48="27" item49="28" item50="29" item51="30" + + + item52="40" item53="41" item54="42" item55="43" item56="44" item57="45" item58="46" item59="47" item60="48" item61="49" item62="50" + + + item63="40" item64="41" item65="42" item66="43" item67="44" item68="45" item69="46" item70="47" item71="48" item72="49" item73="50" + + item74="50" item75="50" item76="50" item77="50" item78="50" item79="50" item80="50" item81="50" item82="50" + item83="50" item89="50" item90="50" item91="50" item92="50" item84="50" item85="50" item86="50" item87="50" item88="50" + + ... [truncated message content] |
From: Germano F. <ger...@gm...> - 2008-03-16 22:28:55
|
Hi everyone... A private list for developers is a good ideia! Thanks for adding me. On Sun, Mar 16, 2008 at 7:12 PM, Rafael H Bordini <r.b...@du...> wrote: > Hi Jomi, Germano, Gauthier, and Tom, > > We have finally managed to create a (private) > email lists for the Jason Developers. I took > the liberty of subscribing you all, with > your SourceForge emails. Hope this will reach > you all OK. > > Best, > > Rafael > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Jason-developers mailing list > Jas...@li... > https://lists.sourceforge.net/lists/listinfo/jason-developers > -- Germano Fronza http://gfronza.blogspot.com/ msn: man...@ho... gtalk: ger...@gm... |
From: Rafael H B. <r.b...@du...> - 2008-03-16 22:13:10
|
Hi Jomi, Germano, Gauthier, and Tom, We have finally managed to create a (private) email lists for the Jason Developers. I took the liberty of subscribing you all, with your SourceForge emails. Hope this will reach you all OK. Best, Rafael |
From: <tom...@us...> - 2008-03-16 17:44:52
|
Revision: 1155 http://jason.svn.sourceforge.net/jason/?rev=1155&view=rev Author: tomklapiscak Date: 2008-03-16 10:44:47 -0700 (Sun, 16 Mar 2008) Log Message: ----------- Run-time class definition implemented. Switched to use the OWL-API Manchester OWL Syntax parser as opposed to Clexer. Additionally, class-definitions now include namespace prefixes for entities and can span any entity from any ontology known to the agent. Dropped "origin" annotation -> run-time defined classes are distinguished inherently now since they "reside" in an agent's "personal" ontology. Individuals defined at run-time also reside in this ontology. Further work on semantically-enriched knowledge sharing. Switched to using OWL-API Manchester OWL Syntax renderer for generation of class expressions to be shared. Modified Paths: -------------- trunk/applications/jasdl-owlapi/examples/travel_agent/config.mas2j trunk/applications/jasdl-owlapi/examples/travel_agent/customer.asl trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/travel.owl trunk/applications/jasdl-owlapi/examples/travel_agent/travel_agent.asl trunk/applications/jasdl-owlapi/src/jasdl/architecture/IncomingPropContProcessingStrategy.java trunk/applications/jasdl-owlapi/src/jasdl/architecture/JasdlAgArch.java trunk/applications/jasdl-owlapi/src/jasdl/architecture/OutgoingPropContProcessingStrategy.java trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlAgent.java trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlConfigurator.java trunk/applications/jasdl-owlapi/src/jasdl/bridge/MappingManager.java trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteral.java trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteralFactory.java Added Paths: ----------- trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/places.owl trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/OntologyURIManager.java trunk/applications/jasdl-owlapi/src/jasdl/ia/ trunk/applications/jasdl-owlapi/src/jasdl/ia/define_class.java Removed Paths: ------------- trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/PhysicalURIManager.java Modified: trunk/applications/jasdl-owlapi/examples/travel_agent/config.mas2j =================================================================== --- trunk/applications/jasdl-owlapi/examples/travel_agent/config.mas2j 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/examples/travel_agent/config.mas2j 2008-03-16 17:44:47 UTC (rev 1155) @@ -33,11 +33,14 @@ travel_agent travel_agent.asl [ - jasdl_ontologies="travel", + jasdl_ontologies="travel,places", jasdl_travel_uri="http://www.dur.ac.uk/t.g.klapiscak/onts/travel.owl", jasdl_travel_mapping_strategies="jasdl.bridge.alias.DecapitaliseMappingStrategy", - jasdl_travel_mapping_manual="small_beach=beach" + jasdl_travel_mapping_manual="small_beach=beach", + jasdl_places_uri="http://www.dur.ac.uk/t.g.klapiscak/onts/places.owl", + jasdl_places_mapping_strategies="jasdl.bridge.alias.DecapitaliseMappingStrategy" + //,jasdl_aktors_uri="http://www.aktors.org/ontology/portal.owl", //jasdl_aktors_mapping_strategies="jasdl.bridge.alias.DecapitaliseMappingStrategy" ] @@ -50,8 +53,8 @@ customer.asl [ jasdl_ontologies="holidays", + //jasdl_holidays_uri="file:///home/tom/Desktop/Project/workspace/jason/applications/jasdl-owlapi/examples/travel_agent/ontologies/travel.owl", jasdl_holidays_uri="http://www.dur.ac.uk/t.g.klapiscak/onts/travel.owl", - //jasdl_holidays_uri="file:///home/tom/Desktop/Project/workspace/jason/applications/jasdl-owlapi/examples/travel_agent/ontologies/travel.owl", jasdl_holidays_mapping_strategies="jasdl.bridge.alias.DecapitaliseMappingStrategy", jasdl_holidays_mapping_manual="small_beach=beach, luxuriousHotel=LuxuryHotel" // arbitrary primitive mappings handled correctly Modified: trunk/applications/jasdl-owlapi/examples/travel_agent/customer.asl =================================================================== --- trunk/applications/jasdl-owlapi/examples/travel_agent/customer.asl 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/examples/travel_agent/customer.asl 2008-03-16 17:44:47 UTC (rev 1155) @@ -21,12 +21,12 @@ +luxuriousHotel(L)[o(holidays), source(Source)] <- /* 1 */ .print("The ", L, " luxurious hotel is available"); - /* 2 */ jasdl.ia.define_class(query, "city and hasAccommodation value ", L, holidays); + /* 2 */ jasdl.ia.define_class(query, "city and hasAccommodation value ", L); /* 3 */ .send(Source, askOne, query(City)[o(holidays)], query(City)[o(holidays)]); /* 4 */ .print(L, " is located in the city ", City); // check given hotel is located in a destination that has some museums - jasdl.ia.define_class(q2, "{",L,"} and isLocatedAt some (hasActivity some museums)", holidays); + jasdl.ia.define_class(q2, "{",L,"} and isLocatedAt some (hasActivity some museums)"); .send(Source, askOne, q2(Hotel)[o(holidays)], q2(Hotel)[o(holidays)]); .print(Hotel, " is located in a city with some museums"); Added: trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/places.owl =================================================================== --- trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/places.owl (rev 0) +++ trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/places.owl 2008-03-16 17:44:47 UTC (rev 1155) @@ -0,0 +1,58 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY owl11 "http://www.w3.org/2006/12/owl11#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY owl11xml "http://www.w3.org/2006/12/owl11-xml#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > + <!ENTITY places "http://www.dur.ac.uk/t.g.klapiscak/ontologies/places.owl#" > +]> + + +<rdf:RDF xmlns="http://www.dur.ac.uk/t.g.klapiscak/ontologies/places.owl#" + xml:base="http://www.dur.ac.uk/t.g.klapiscak/ontologies/places.owl" + xmlns:places="http://www.dur.ac.uk/t.g.klapiscak/ontologies/places.owl#" + xmlns:owl11="http://www.w3.org/2006/12/owl11#" + xmlns:owl11xml="http://www.w3.org/2006/12/owl11-xml#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:owl="http://www.w3.org/2002/07/owl#"> + <owl:Ontology rdf:about=""/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.dur.ac.uk/t.g.klapiscak/ontologies/places.owl#Building --> + + <owl:Class rdf:about="#Building"> + <rdfs:subClassOf rdf:resource="#Place"/> + </owl:Class> + + + + <!-- http://www.dur.ac.uk/t.g.klapiscak/ontologies/places.owl#Place --> + + <owl:Class rdf:about="#Place"> + <rdfs:subClassOf rdf:resource="&owl;Thing"/> + </owl:Class> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> +</rdf:RDF> Modified: trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/travel.owl =================================================================== --- trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/travel.owl 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/examples/travel_agent/ontologies/travel.owl 2008-03-16 17:44:47 UTC (rev 1155) @@ -323,9 +323,6 @@ <rdfs:subClassOf rdf:resource="#Destination"/> </owl:Class> - <owl:Class rdf:about="#beach"> - <rdfs:subClassOf rdf:resource="#Destination"/> - </owl:Class> <!-- http://www.owl-ontologies.com/travel.owl#BedAndBreakfast --> @@ -677,6 +674,14 @@ + <!-- http://www.owl-ontologies.com/travel.owl#beach --> + + <owl:Class rdf:about="#beach"> + <rdfs:subClassOf rdf:resource="#Destination"/> + </owl:Class> + + + <!-- http://www.w3.org/2002/07/owl#Thing --> <owl:Class rdf:about="&owl;Thing"/> @@ -709,9 +714,9 @@ <!-- http://www.owl-ontologies.com/travel.owl#TwoStarRating --> <AccommodationRating rdf:about="#TwoStarRating"/> + - <!-- /////////////////////////////////////////////////////////////////////////////////////// // Modified: trunk/applications/jasdl-owlapi/examples/travel_agent/travel_agent.asl =================================================================== --- trunk/applications/jasdl-owlapi/examples/travel_agent/travel_agent.asl 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/examples/travel_agent/travel_agent.asl 2008-03-16 17:44:47 UTC (rev 1155) @@ -45,6 +45,15 @@ +hasActivity(london, scienceMuseum)[o(travel)]; +hotel(travel_lodge)[o(travel)]; + +building(hilton)[o(places)]; + + ?place(Place)[o(places)]; + .print(Place); + + jasdl.ia.define_class(q2, "(places:place and places:building) and travel:hotel"); + ?q2(X)[o(self)]; + .print(X); + .print("Completed: Updating Belief Base 1"). @@ -121,11 +130,11 @@ +hasActivity(butlins, butlins_yoga)[o(travel)]; +hasActivity(butlins, butlins_sunbathing)[o(travel)]; //jasdl.ia.all_different([butlins_yoga, butlins_sunbathing], travel); - DEPRECATED (see below) - +all_different([butlins_yoga, butlins_sunbathing])[o(travel), something]; // all_different now represented as an se-literal. We can now query, inspect and send these assertions + +all_different([butlins_yoga, butlins_sunbathing])[o(self), something]; // all_different now represented as an se-literal. We can now query, inspect and send these assertions // Query below will not succeed unless butlins_yoga and butlins_sunbathing are different individuals since family destination requires min 2 *different* activities. // Note: OWL doesn't make UNA and since these individuals do not belong to disjoint classes, therefore they must be explicitly asserted as different. ?familyDestination(butlins)[o(travel)]; - ?all_different([butlins_yoga, butlins_sunbathing, hilton])[o(travel)]; + ?all_different([butlins_yoga, butlins_sunbathing, hilton])[o(self)]; /* ?all_different([hilton, fourSeasons])[o(travel)]; */ // Will fail, since hilton and fourSeasons cannot be established as distinct .print("Completed: all_different assertion"). Modified: trunk/applications/jasdl-owlapi/src/jasdl/architecture/IncomingPropContProcessingStrategy.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/architecture/IncomingPropContProcessingStrategy.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/architecture/IncomingPropContProcessingStrategy.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -19,6 +19,8 @@ */ package jasdl.architecture; +import static jasdl.architecture.JasdlAgArch.NAMED_ANNOTATION_FUNCTOR; +import static jasdl.architecture.JasdlAgArch.ANON_ANNOTATION_FUNCTOR; import jasdl.asSemantics.JasdlAgent; import jasdl.bridge.seliteral.SELiteral; import jasdl.util.JasdlException; Modified: trunk/applications/jasdl-owlapi/src/jasdl/architecture/JasdlAgArch.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/architecture/JasdlAgArch.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/architecture/JasdlAgArch.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -36,6 +36,8 @@ public class JasdlAgArch extends AgArch { + public static String NAMED_ANNOTATION_FUNCTOR = "named"; + public static String ANON_ANNOTATION_FUNCTOR = "anon"; IncomingPropContProcessingStrategy incomingStrategy = new IncomingPropContProcessingStrategy(); OutgoingPropContProcessingStrategy outgoingStrategy = new OutgoingPropContProcessingStrategy(); Modified: trunk/applications/jasdl-owlapi/src/jasdl/architecture/OutgoingPropContProcessingStrategy.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/architecture/OutgoingPropContProcessingStrategy.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/architecture/OutgoingPropContProcessingStrategy.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -19,14 +19,27 @@ */ package jasdl.architecture; +import static jasdl.architecture.JasdlAgArch.ANON_ANNOTATION_FUNCTOR; +import static jasdl.architecture.JasdlAgArch.NAMED_ANNOTATION_FUNCTOR; import jasdl.asSemantics.JasdlAgent; +import jasdl.bridge.alias.Alias; import jasdl.bridge.seliteral.SELiteral; import jasdl.util.JasdlException; import jasdl.util.NotEnrichedException; +import jason.asSyntax.ListTerm; +import jason.asSyntax.ListTermImpl; import jason.asSyntax.Literal; +import jason.asSyntax.StringTerm; import jason.asSyntax.StringTermImpl; import jason.asSyntax.Structure; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.HashSet; +import java.util.Set; + +import org.semanticweb.owl.model.OWLOntology; + public class OutgoingPropContProcessingStrategy implements PropContProcessingStrategy { @@ -40,13 +53,52 @@ */ public Literal process(Literal l, JasdlAgent agent) throws JasdlException { try{ - SELiteral sl = new SELiteral(l, agent); // note, l might not (yet) be a valid se-literal (mappings may be performed below) so factory cannot be used - sl.qualifyOntologyAnnotation(); + SELiteral sl = new SELiteral(l, agent); - Structure expr = new Structure("expr"); - expr.addTerm(new StringTermImpl( agent.getManchesterObjectRenderer().render(sl.toOWLObject()) )); - sl.addAnnot(expr); + StringTerm expression = new StringTermImpl( agent.getManchesterObjectRenderer().render(sl.toOWLObject())); + + Alias alias = sl.toAlias(); + if(alias.getLabel().equals(agent.getPersonalOntologyLabel())){ // do we have an anonymous run-time defined class? + + Structure anon = new Structure(ANON_ANNOTATION_FUNCTOR); + anon.addTerm(expression); + + // add set of prerequisite ontologies + Set<OWLOntology> prereqs = new HashSet<OWLOntology>(); + String[] tokens = expression.toString().split(" "); + for(String token : tokens){ + try { + URI entityURI = new URI(token); + URI ontologyURI = new URI(entityURI.getScheme(), entityURI.getSchemeSpecificPart(), null); + prereqs.add(agent.getLogicalURIManager().getLeft(ontologyURI)); + } catch (URISyntaxException e) { + // do nothing, probably a keyword + } + } + ListTerm list = new ListTermImpl(); + for(OWLOntology prereq : prereqs){ + list.add(agent.getLabelManager().getLeft(prereq)); + } + anon.addTerm(list); + + l.addAnnot(anon); + + // drop o, not needed + sl.dropOntologyAnnotation(); + + }else{ + // qualify o + sl.qualifyOntologyAnnotation(); + + // unambiguously refer to named entity + Structure named = new Structure(NAMED_ANNOTATION_FUNCTOR); + named.addTerm(expression); + sl.addAnnot(named); + } + + + return sl; }catch(NotEnrichedException e){ // do nothing Modified: trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlAgent.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlAgent.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlAgent.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -4,11 +4,14 @@ import jasdl.bb.JasdlBeliefBase; import jasdl.bridge.ToAxiomConverter; import jasdl.bridge.ToSELiteralConverter; +import jasdl.bridge.alias.Alias; +import jasdl.bridge.alias.AliasFactory; import jasdl.bridge.alias.AliasManager; import jasdl.bridge.label.LabelManager; -import jasdl.bridge.label.PhysicalURIManager; +import jasdl.bridge.label.OntologyURIManager; import jasdl.bridge.seliteral.SELiteralFactory; import jasdl.util.JasdlException; +import jasdl.util.UnknownMappingException; import jason.JasonException; import jason.architecture.AgArch; import jason.asSemantics.TransitionSystem; @@ -17,19 +20,32 @@ import jason.runtime.Settings; import java.net.URI; +import java.net.URISyntaxException; import java.util.Set; import jmca.asSemantics.JmcaAgent; +import org.coode.manchesterowlsyntax.ManchesterOWLSyntaxDescriptionParser; import org.mindswap.pellet.PelletOptions; import org.mindswap.pellet.owlapi.Reasoner; import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.expression.OWLEntityChecker; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLDataProperty; +import org.semanticweb.owl.model.OWLDataType; +import org.semanticweb.owl.model.OWLDescription; +import org.semanticweb.owl.model.OWLEntity; +import org.semanticweb.owl.model.OWLIndividual; +import org.semanticweb.owl.model.OWLObject; +import org.semanticweb.owl.model.OWLObjectProperty; import org.semanticweb.owl.model.OWLOntology; import org.semanticweb.owl.model.OWLOntologyCreationException; import org.semanticweb.owl.model.OWLOntologyManager; +import org.semanticweb.owl.model.OWLRuntimeException; +import org.semanticweb.owl.util.ShortFormProvider; +import uk.ac.manchester.cs.owl.OWLClassImpl; import uk.ac.manchester.cs.owl.mansyntaxrenderer.ManchesterOWLSyntaxOWLObjectRendererImpl; -import uk.ac.manchester.cs.owl.mansyntaxrenderer.ManchesterOWLSyntaxObjectRenderer; public class JasdlAgent extends JmcaAgent { private OWLOntologyManager ontologyManager; @@ -39,23 +55,38 @@ private SELiteralFactory seLiteralFactory; private ToSELiteralConverter toSELiteralConverter; private ToAxiomConverter toAxiomConverter; - private PhysicalURIManager physicalURIManager; + private OntologyURIManager logicalURIManager; + private OntologyURIManager physicalURIManager; private ManchesterOWLSyntaxOWLObjectRendererImpl manchesterObjectRenderer; + private ManchesterOWLSyntaxDescriptionParser manchesterDescriptionParser; + + public JasdlAgent(){ super(); // instantiate managers aliasManager = new AliasManager(); labelManager = new LabelManager(); ontologyManager = OWLManager.createOWLOntologyManager(); - physicalURIManager = new PhysicalURIManager(); + physicalURIManager = new OntologyURIManager(); + logicalURIManager = new OntologyURIManager(); + seLiteralFactory = new SELiteralFactory(this); toAxiomConverter = new ToAxiomConverter(this); toSELiteralConverter = new ToSELiteralConverter(this); manchesterObjectRenderer = new ManchesterOWLSyntaxOWLObjectRendererImpl(); + manchesterObjectRenderer.setShortFormProvider(new ShortFormProvider(){ + public void dispose() { + } + public String getShortForm(OWLEntity entity) { + return entity.getURI().toString(); + } + }); // we want fully qualified entity references + manchesterDescriptionParser = new ManchesterOWLSyntaxDescriptionParser(ontologyManager.getOWLDataFactory(), new NSPrefixEntityChecker(this)); + // instantiate (Pellet) reasoner PelletOptions.USE_TRACING = true; reasoner = new Reasoner(ontologyManager); @@ -78,7 +109,7 @@ // load .mas2j JASDL configuration JasdlConfigurator config = new JasdlConfigurator(this); - config.configure(stts); + config.configure(stts); return super.initAg(arch, bb, src, stts); } @@ -97,13 +128,54 @@ reasoner.classify(); labelManager.put(label, ontology); physicalURIManager.put(ontology, uri); + logicalURIManager.put(ontology, ontology.getURI()); }catch(OWLOntologyCreationException e){ throw new JasdlException("Error loading ontology "+uri+". Reason: "+e); } } + + + public void createOntology(Atom label, URI uri) throws JasdlException{ + try{ + OWLOntology ontology = getOntologyManager().createOntology( uri ); + getLabelManager().put(label, ontology); + getPhysicalURIManager().put(ontology, uri); + getLogicalURIManager().put(ontology, uri); + getReasoner().loadOntology(ontology); + } catch (OWLOntologyCreationException e) { + throw new JasdlException("Error instantiating OWL ontology. Reason: "+e); + } + } + + public Atom getPersonalOntologyLabel(){ + return new Atom("self"); + } + + public URI getPersonalOntologyURI() { + return URI.create("http://www.dur.ac.uk/t.g.klapiscak/"+getPersonalOntologyLabel()+".owl"); + } + + + + public OWLDescription defineClass(Atom functor, String expression) throws JasdlException{ + OWLDescription desc; + try{ + desc = getManchesterDescriptionParser().parse(expression); + }catch(Exception e){ + e.printStackTrace(); + throw new JasdlException("Could not parse expression "+expression+". Reason: "+e); + } + + Alias alias = AliasFactory.INSTANCE.create(functor, getPersonalOntologyLabel()); + getAliasManager().put(alias, desc); + + return desc; + } + + public AliasManager getAliasManager() { return aliasManager; } @@ -124,12 +196,19 @@ - public PhysicalURIManager getPhysicalURIManager() { + public OntologyURIManager getPhysicalURIManager() { return physicalURIManager; } + + + public OntologyURIManager getLogicalURIManager() { + return logicalURIManager; + } + + public Reasoner getReasoner() { return reasoner; } @@ -164,11 +243,135 @@ public ManchesterOWLSyntaxOWLObjectRendererImpl getManchesterObjectRenderer() { return manchesterObjectRenderer; } + + + + public ManchesterOWLSyntaxDescriptionParser getManchesterDescriptionParser() { + return manchesterDescriptionParser; + } + /** + * Convenience method to (polymorphically) create an entity from resource URI (if known). + * TODO: where should this sit? + * @param uri URI of resource to create entity from + * @return entity identified by URI + * @throws UnknownReferenceException if OWLObject not known + */ + public OWLEntity toEntity(URI uri) throws JasdlException{ + URI ontURI; + try { + ontURI = new URI(uri.getScheme(), uri.getSchemeSpecificPart(), null); + } catch (URISyntaxException e) { + throw new JasdlException("Invalid entity URI "+uri); + } + OWLOntology ontology = getLogicalURIManager().getLeft(ontURI);; + + // clumsy approach, but I can't find any way of achieving this polymorphically (i.e. retrieve an OWLObject from a URI) using OWL-API + OWLEntity entity; + if(ontology.containsClassReference(uri)){ + entity = getOntologyManager().getOWLDataFactory().getOWLClass(uri); + }else if (ontology.containsObjectPropertyReference(uri)){ + entity = getOntologyManager().getOWLDataFactory().getOWLObjectProperty(uri); + }else if (ontology.containsDataPropertyReference(uri)){ + entity = getOntologyManager().getOWLDataFactory().getOWLDataProperty(uri); + }else if (ontology.containsIndividualReference(uri)){ + entity = getOntologyManager().getOWLDataFactory().getOWLIndividual(uri); + }else{ + throw new UnknownMappingException("Unknown ontology resource URI: "+uri); + } + return entity; + } + + + + private class NSPrefixEntityChecker implements OWLEntityChecker{ + + private JasdlAgent agent; + public NSPrefixEntityChecker(JasdlAgent agent){ + this.agent = agent; + } + public OWLClass getOWLClass(String name) { + OWLEntity entity = convert(name); + if(entity == null){ + return null; + } + if(entity.isOWLClass()){ + return entity.asOWLClass(); + }else{ + return null; + } + } + public OWLDataProperty getOWLDataProperty(String name) { + OWLEntity entity = convert(name); + if(entity == null){ + return null; + } + if(entity.isOWLDataProperty()){ + return entity.asOWLDataProperty(); + }else{ + return null; + } + } + public OWLDataType getOWLDataType(String name) { + OWLEntity entity = convert(name); + if(entity == null){ + return null; + } + if(entity.isOWLDataType()){ + return entity.asOWLDataType(); + }else{ + return null; + } + } + + public OWLIndividual getOWLIndividual(String name) { + OWLEntity entity = convert(name); + if(entity == null){ + return null; + } + if(entity.isOWLIndividual()){ + return entity.asOWLIndividual(); + }else{ + return null; + } + } + + public OWLObjectProperty getOWLObjectProperty(String name) { + OWLEntity entity = convert(name); + if(entity == null){ + return null; + } + if(entity.isOWLObjectProperty()){ + return entity.asOWLObjectProperty(); + }else{ + return null; + } + } + + private OWLEntity convert(String name){ + String[] tokens = name.split(":"); + try { + Atom functor = new Atom(tokens[1]); + Atom label = new Atom(tokens[0]); + Alias alias = AliasFactory.INSTANCE.create(functor, label); + return (OWLEntity)agent.getAliasManager().getRight(alias); // guaranteed to be an entity? Not for anonymous classes! + } catch (Exception e) { + return null; + } + } + + + } + + + + + + } Modified: trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlConfigurator.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlConfigurator.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/asSemantics/JasdlConfigurator.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -14,6 +14,7 @@ import java.lang.reflect.Constructor; import java.net.URI; +import java.net.URISyntaxException; import java.util.List; import java.util.Set; import java.util.Vector; @@ -76,7 +77,7 @@ if(split.length == 2){ Alias alias = AliasFactory.INSTANCE.create(new Atom(split[0].trim()), label); URI uri = URI.create(ontology.getURI() + "#" + split[1].trim()); - OWLEntity entity = toEntity(ontology, uri); + OWLEntity entity = agent.toEntity(uri); agent.getAliasManager().put(alias, entity); } } @@ -147,18 +148,11 @@ */ private void applyMiscMappings() throws JasdlException{ - // create a "placeholder" ontology so we can safely map thing and nothing without actually loading the ontology - try { - URI uri = URI.create("http://www.w3.org/2002/07/owl"); - OWLOntology ontology = agent.getOntologyManager().createOntology( uri ); - agent.getLabelManager().put(AliasFactory.OWL_THING.getLabel(), ontology); - agent.getPhysicalURIManager().put(ontology, uri); - agent.getReasoner().loadOntology(ontology); + agent.createOntology(AliasFactory.OWL_THING.getLabel(), URI.create("http://www.w3.org/2002/07/owl")); - } catch (OWLOntologyCreationException e) { - throw new JasdlException("Error instantiating blank OWL ontology placeholder. Reason: "+e); - } + // create a personal ontology for (axioms that reference) run-time defined class + agent.createOntology(agent.getPersonalOntologyLabel(), agent.getPersonalOntologyURI()); agent.getAliasManager().put( AliasFactory.OWL_THING, agent.getOntologyManager().getOWLDataFactory().getOWLThing()); agent.getAliasManager().put( AliasFactory.OWL_NOTHING, agent.getOntologyManager().getOWLDataFactory().getOWLNothing()); @@ -217,38 +211,5 @@ - /** - * Convenience method to (polymorphically) create an entity from resource URI (if known). - * TODO: where should this sit? - * @param uri URI of resource to create entity from - * @return entity identified by URI - * @throws UnknownReferenceException if OWLObject not known - */ - private OWLEntity toEntity(OWLOntology ontology, URI uri) throws UnknownMappingException{ - // clumsy approach, but I can't find any way of achieving this polymorphically (i.e. retrieve an OWLObject from a URI) using OWL-API - OWLEntity entity; - - /* - // TODO: make from uri only version once OWLOntologyManager#getOntology(URI) is fixed - URI ns = URI.create(uri.getScheme() + uri.getSchemeSpecificPart()); - OWLOntology ontology; - try { - ontology = ontologyManager.getOntology(ns); - } catch (UnknownOWLOntologyException e) { - throw new UnknownMappingException("Unknown ontology URI "+ns); - } - */ - if(ontology.containsClassReference(uri)){ - entity = agent.getOntologyManager().getOWLDataFactory().getOWLClass(uri); - }else if (ontology.containsObjectPropertyReference(uri)){ - entity = agent.getOntologyManager().getOWLDataFactory().getOWLObjectProperty(uri); - }else if (ontology.containsDataPropertyReference(uri)){ - entity = agent.getOntologyManager().getOWLDataFactory().getOWLDataProperty(uri); - }else if (ontology.containsIndividualReference(uri)){ - entity = agent.getOntologyManager().getOWLDataFactory().getOWLIndividual(uri); - }else{ - throw new UnknownMappingException("Unknown ontology resource URI: "+uri); - } - return entity; - } + } Modified: trunk/applications/jasdl-owlapi/src/jasdl/bridge/MappingManager.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/bridge/MappingManager.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/bridge/MappingManager.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -35,6 +35,7 @@ * @throws DuplicateMappingException if either alias or entity is already mapped (thus breaking 1 <-> 1 constraint) */ public void put(X x, Y y) throws DuplicateMappingException{ + logger.fine("mapping "+x+" <-> "+y); if(isKnownLeft(x)){ throw new DuplicateMappingException("Duplicate mapping on "+x); @@ -72,7 +73,7 @@ public Y getRight(X x) throws UnknownMappingException{ Y y = xToYMap.get(x); if(y == null){ - throw new UnknownMappingException("Unknown mapping "+y); + throw new UnknownMappingException("Unknown mapping "+x); } return y; } Copied: trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/OntologyURIManager.java (from rev 1147, trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/PhysicalURIManager.java) =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/OntologyURIManager.java (rev 0) +++ trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/OntologyURIManager.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -0,0 +1,11 @@ +package jasdl.bridge.label; + +import jasdl.bridge.MappingManager; + +import java.net.URI; + +import org.semanticweb.owl.model.OWLOntology; + +public class OntologyURIManager extends MappingManager<OWLOntology, URI> { + +} Deleted: trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/PhysicalURIManager.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/PhysicalURIManager.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/bridge/label/PhysicalURIManager.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -1,11 +0,0 @@ -package jasdl.bridge.label; - -import jasdl.bridge.MappingManager; - -import java.net.URI; - -import org.semanticweb.owl.model.OWLOntology; - -public class PhysicalURIManager extends MappingManager<OWLOntology, URI> { - -} Modified: trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteral.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteral.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteral.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -37,7 +37,6 @@ protected JasdlAgent agent; public static String ONTOLOGY_ANNOTATION_FUNCTOR = "o"; - public static String EXPR_ANNOTATION_FUNCTOR = "expr"; protected Structure ontologyAnnotation; @@ -78,25 +77,12 @@ ontologyLabel = (Atom)ontologyAnnotation.getTerm(0); ontology = agent.getLabelManager().getRight(ontologyLabel); }else if(ontologyAnnotation.getTerm(0).isString()){ - // Incoming SELiteral parseOntologyURI(ontologyAnnotation.getTerm(0).toString()); }else{ throw invalid; } - - // look for expr annotation - // Do I really want expressions to be limited within a single ontology?? - // would make things easier! - //Structure exprAnnotation = getAnnots(EXPR_ANNOTATION_FUNCTOR); - - - - - //if(!agent.getAliasManager().isKnownLeft( toAlias() )){ - // throw new UnknownMappingException(l+" refers to an unknown resource"); - //} - } + private void parseOntologyURI(String _uri) throws JasdlException{ URI uri; @@ -109,7 +95,7 @@ ontology = agent.getPhysicalURIManager().getLeft(uri); ontologyLabel = agent.getLabelManager().getLeft(ontology); }catch(UnknownMappingException e){ - // instantiate novel ontology + // TODO: instantiate novel ontology } } @@ -127,7 +113,11 @@ ontologyAnnotation.setTerm(0, ontologyLabel); } + public void dropOntologyAnnotation(){ + delAnnot(ontologyAnnotation); + } + /** * Prevents uneccessary re-processing steps * @param l @@ -215,8 +205,11 @@ } /** - * Placed here for convenient (varying) usage by subclasses - * Validates since terms are mutable + * Attempts to fetch individual from "parent" ontologies (i.e. that referred to by ontology label of enclosing SELiteral). + * If not present, attempts to fetch from personal ontology. + * If not present, instantiates in personal ontology. + * Placed here for convenient (varying) usage by subclasses. + * Validates since terms are mutable. * @return * @throws UnknownMappingException */ @@ -225,18 +218,22 @@ throw new InvalidSELiteralException(term+" must be atomic"); } Atom atom = (Atom)term; - Alias alias = AliasFactory.INSTANCE.create(atom, ontologyLabel); OWLIndividual i; try { - i = (OWLIndividual)agent.getAliasManager().getRight(alias); - } catch (UnknownMappingException e) { - // Instantiate and map the individual if not known - OWLOntology ontology = getOntology(); - // Clashes (with different types of resource) don't matter thanks to OWL1.1's punning features - //TODO: what about clashes with individuals (different alias, same uri) - URI uri = URI.create(ontology.getURI() + "#" + atom); - i = agent.getOntologyManager().getOWLDataFactory().getOWLIndividual(uri); - agent.getAliasManager().put(alias, i); + i = (OWLIndividual)agent.getAliasManager().getRight(AliasFactory.INSTANCE.create(atom, ontologyLabel)); + } catch (UnknownMappingException e1) { + Alias alias = AliasFactory.INSTANCE.create(atom, agent.getPersonalOntologyLabel()); + try { + i = (OWLIndividual)agent.getAliasManager().getRight(alias); + } catch (UnknownMappingException e2) { + // Instantiate and map the individual if not known + OWLOntology ontology = getOntology(); + // Clashes (with different types of resource) don't matter thanks to OWL1.1's punning features + //TODO: what about clashes with individuals (different alias, same uri) + URI uri = URI.create(ontology.getURI() + "#" + atom); + i = agent.getOntologyManager().getOWLDataFactory().getOWLIndividual(uri); + agent.getAliasManager().put(alias, i); + } } catch(ClassCastException e){ throw new InvalidSELiteralException(atom+" does not refer to an individual"); } Modified: trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteralFactory.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteralFactory.java 2008-03-16 16:43:27 UTC (rev 1154) +++ trunk/applications/jasdl-owlapi/src/jasdl/bridge/seliteral/SELiteralFactory.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -33,7 +33,8 @@ if(entity instanceof OWLDescription){ return new SELiteralClassAssertion(sl); }else if(entity instanceof AllDifferentPlaceholder){ - if(!l.isGround()) throw new JasdlException("JASDL does not currently support unground all_different assertions such as "+l); + //if(!l.isGround()) throw new JasdlException("JASDL does not currently support unground all_different assertions such as "+l); + // TODO: can ensure this here (due to unground TG all_different literals), where should I? axiom converter? if(l.negated()) throw new JasdlException("JASDL does not currently support negated all_different assertions such as "+l+", since OWL makes the UNA by default and JASDL doesn't allow this to be overridden"); return new SELiteralAllDifferentAssertion(sl); }else{ Added: trunk/applications/jasdl-owlapi/src/jasdl/ia/define_class.java =================================================================== --- trunk/applications/jasdl-owlapi/src/jasdl/ia/define_class.java (rev 0) +++ trunk/applications/jasdl-owlapi/src/jasdl/ia/define_class.java 2008-03-16 17:44:47 UTC (rev 1155) @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2008 Thomas Klapiscak (t.g...@du...) + * + * This file is part of JASDL. + * + * JASDL is free software: you can redistribute it and/or modify + * it under the terms of the Lesser GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * JASDL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Lesser GNU General Public License for more details. + * + * You should have received a copy of the Lesser GNU General Public License + * along with JASDL. If not, see <http://www.gnu.org/licenses/>. + * + */ +package jasdl.ia; + +import static jasdl.util.Common.strip; +import jasdl.asSemantics.JasdlAgent; +import jasdl.util.JasdlException; +import jason.asSemantics.DefaultInternalAction; +import jason.asSemantics.TransitionSystem; +import jason.asSemantics.Unifier; +import jason.asSyntax.Atom; +import jason.asSyntax.Term; + +import java.util.logging.Logger; + +/** + * @author Tom Klapiscak + * + * Usage jasdl.ia.define_class(classname, classexpr, label), where: + * - classname is an atomic name used to refer to this class in future. Must begin with a lowercase letter and not clash with any AgentSpeak keyword + * - classexpr is a expression defining this class + * + * Changed class name to atom only - forces valid alias syntax + * + */ +public class define_class extends DefaultInternalAction { + + + private Logger logger = Logger.getLogger("jasdl."+define_class.class.getName()); + + @Override + public Object execute(TransitionSystem ts, Unifier un, Term[] args) throws Exception { + try { + // class name ATOM + Term _classname = args[0]; + if(!_classname.isAtom()){ + throw new JasdlException("first argument must be a Atom containing a valid class name"); + } + Atom classname = (Atom)_classname; + + // concat expression strings / atoms, with limited validity checks + String expr = ""; + for(int i = 1; i<args.length; i++){ + if(args[i].isString()){ + expr+=strip(args[i].toString(), "\""); + }else if(args[i].isAtom()){ + expr+=args[i].toString(); + }else{ + throw new JasdlException("Invalid expression component: "+args[i]); + } + } + + JasdlAgent agent = (JasdlAgent)ts.getAg(); + + agent.defineClass(classname, expr); + + + return true; + } catch (Exception e) { + logger.warning("Error in internal action 'jasdl.ia.define_class'! Reason:"); e.printStackTrace(); + + return false; + } + } + + + +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jom...@us...> - 2008-03-16 16:43:31
|
Revision: 1154 http://jason.svn.sourceforge.net/jason/?rev=1154&view=rev Author: jomifred Date: 2008-03-16 09:43:27 -0700 (Sun, 16 Mar 2008) Log Message: ----------- change jason team todo (test of jason-developers list) Modified Paths: -------------- trunk/applications/jason-team/todo.org Modified: trunk/applications/jason-team/todo.org =================================================================== --- trunk/applications/jason-team/todo.org 2008-03-16 16:29:57 UTC (rev 1153) +++ trunk/applications/jason-team/todo.org 2008-03-16 16:43:27 UTC (rev 1154) @@ -9,8 +9,7 @@ ** computation of ideal locations of an agent to maintain a formation (can we use maintainance goal pattern?) * protocols * exploration strategy - details - + details * herding strategy details * DONE A* (update previous to new directions) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jom...@us...> - 2008-03-16 16:29:59
|
Revision: 1153 http://jason.svn.sourceforge.net/jason/?rev=1153&view=rev Author: jomifred Date: 2008-03-16 09:29:57 -0700 (Sun, 16 Mar 2008) Log Message: ----------- update jason team run script Modified Paths: -------------- trunk/applications/jason-team/run.sh trunk/applications/jason-team/src/java/arch/ACAgent.java trunk/applications/jason-team/src/java/arch/ACProxy.java Modified: trunk/applications/jason-team/run.sh =================================================================== --- trunk/applications/jason-team/run.sh 2008-03-16 14:29:35 UTC (rev 1152) +++ trunk/applications/jason-team/run.sh 2008-03-16 16:29:57 UTC (rev 1153) @@ -1,5 +1,5 @@ #!/bin/sh -java -cp lib/jason.jar:lib/search.jar:. \ +java -cp ../../lib/jason.jar:lib/search.jar:bin/classes \ jason.infra.centralised.RunCentralisedMAS \ - Local-JasonTeam.mas2j + AC-Local-JasonTeam.mas2j Modified: trunk/applications/jason-team/src/java/arch/ACAgent.java =================================================================== --- trunk/applications/jason-team/src/java/arch/ACAgent.java 2008-03-16 14:29:35 UTC (rev 1152) +++ trunk/applications/jason-team/src/java/arch/ACAgent.java 2008-03-16 16:29:57 UTC (rev 1153) @@ -7,6 +7,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; +import java.net.SocketException; import java.util.logging.Level; import java.util.logging.Logger; @@ -100,14 +101,8 @@ auth.setAttribute("password",password); root.appendChild(auth); this.sendDocument(doc); - //transformerfactory.newTransformer().transform(new DOMSource(doc),new StreamResult(outputstream)); - //outputstream.write(0); } catch (ParserConfigurationException e) { logger.log(Level.SEVERE, "unable to create new document for authentication.", e); - //} catch (TransformerConfigurationException e) { - // logger.log(Level.SEVERE,"unable to configure transformer", e); - //} catch (TransformerException e) { - // logger.log(Level.SEVERE,"unable to transform document", e); } } @@ -116,7 +111,8 @@ Document doc = receiveDocument(); Element root = doc.getDocumentElement(); if (root==null) return false; - if (!root.getAttribute("type").equalsIgnoreCase("auth-response")) return false; + if (!root.getAttribute("type").equalsIgnoreCase("auth-response")) + return false; NodeList nl = root.getChildNodes(); Element authresult = null; @@ -127,19 +123,12 @@ break; } } - if (!authresult.getAttribute("result").equalsIgnoreCase("ok")) return false; - } catch (SAXException e) { + if (authresult.getAttribute("result").equalsIgnoreCase("ok")) + return true; + } catch (Exception e) { e.printStackTrace(); - return false; - } catch (ParserConfigurationException e) { - e.printStackTrace(); - return false; - } catch (SocketClosedException e) { - e.printStackTrace(); - return false; } - - return true; + return false; } public boolean doAuthentication(String username, String password) throws IOException { @@ -160,9 +149,19 @@ return buffer.toByteArray(); } - public Document receiveDocument() throws SAXException, IOException, ParserConfigurationException, SocketClosedException { - byte[] raw = receivePacket(); - Document doc = documentbuilderfactory.newDocumentBuilder().parse(new ByteArrayInputStream(raw)); + public Document receiveDocument() throws SAXException { // , IOException, ParserConfigurationException, SocketClosedException { + try { + byte[] raw = receivePacket(); + Document doc = documentbuilderfactory.newDocumentBuilder().parse(new ByteArrayInputStream(raw)); + return doc; + } catch (SocketClosedException e) { + logger.log(Level.SEVERE, "Socket was closed:"+e); + connected = false; + } catch (SocketException e) { + logger.log(Level.SEVERE, "Socket exception:"+e); + } catch (Exception e) { + logger.log(Level.SEVERE, "ACAgent receiveDocument exception", e); + } /* try { if (logger.isLoggable(Level.FINE)) { @@ -172,7 +171,7 @@ } } catch (Exception e) {} */ - return doc; + return null; } protected boolean connect() { @@ -190,7 +189,7 @@ logger.log(Level.SEVERE, "authentication failed"); } } catch (Exception e) { - logger.log(Level.SEVERE, "Exception", e); + logger.log(Level.SEVERE, "Connection exception "+e); } return connected; } @@ -199,15 +198,6 @@ return connected; } - /* - protected void reconnect() throws Exception { - if (socket != null) { - socket.close(); - } - connect(); - } - */ - public boolean processMessage(Element el_message) { String type = el_message.getAttribute("type"); if (type.equals("request-action") || type.equals("sim-start") || type.equals("sim-end")) { Modified: trunk/applications/jason-team/src/java/arch/ACProxy.java =================================================================== --- trunk/applications/jason-team/src/java/arch/ACProxy.java 2008-03-16 14:29:35 UTC (rev 1152) +++ trunk/applications/jason-team/src/java/arch/ACProxy.java 2008-03-16 16:29:57 UTC (rev 1153) @@ -5,6 +5,7 @@ import jason.asSyntax.Structure; import jason.environment.grid.Location; +import java.net.SocketException; import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -68,29 +69,26 @@ try { if (isConnected()) { Document doc = receiveDocument(); - Element el_root = doc.getDocumentElement(); - - if (el_root != null) { - if (el_root.getNodeName().equals("message")) { - processMessage(el_root); + if (doc != null) { + Element el_root = doc.getDocumentElement(); + + if (el_root != null) { + if (el_root.getNodeName().equals("message")) { + processMessage(el_root); + } else { + logger.log(Level.SEVERE,"unknown document received"); + } } else { - logger.log(Level.SEVERE,"unknown document received"); + logger.log(Level.SEVERE, "no document element found"); } - } else { - logger.log(Level.SEVERE, "no document element found"); } } else { // wait auto-reconnect logger.info("waiting reconnection..."); try { Thread.sleep(2000); } catch (InterruptedException e1) {} } - /*} catch (SocketClosedException e) { - logger.log(Level.SEVERE, "Socket was closed:"+e); - connected = false; - } catch (SocketException e) { - logger.log(Level.SEVERE, "Socket exception:"+e); */ } catch (Exception e) { - logger.log(Level.SEVERE, "Exception", e); + logger.log(Level.SEVERE, "ACProxy run exception", e); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |