diff --git a/.gitignore b/.gitignore index 5c0414078159dbd2eca6681405b1bb794a1ec88d..8dbc75a7012a1f203dbdceb4c5ac579a27b7bde0 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,10 @@ /assignments/src/MV3500Cohort2022MayJune/projects/Royer/TwoCranesBerth/nbproject/private/ /assignments/src/MV3500Cohort2022MayJune/projects/Royer/TwoCranesBerth/nbproject/build-impl.xml~ /assignments/src/MV3500Cohort2022MayJune/projects/Royer/TwoCranesBerth/pduLog/ + +/examples/src/ViskitOpenDis7Examples/AnalystReports/ +/examples/src/ViskitOpenDis7Examples/build/ +/viskit/MyViskitProjects/DefaultProject/build/ +/viskit/MyViskitProjects/DefaultProject/AnalystReports/ +/viskit/logs +/viskit/pduLog/ diff --git a/MV3500DistributedSimulationSyllabus2024JulySeptember.docx b/MV3500DistributedSimulationSyllabus2024JulySeptember.docx index 371f296a678decc875ed2b11f624c42d33bc4654..43164767fdbf08483f6f8b715d1c5ec6ded9b867 100644 Binary files a/MV3500DistributedSimulationSyllabus2024JulySeptember.docx and b/MV3500DistributedSimulationSyllabus2024JulySeptember.docx differ diff --git a/MV3500DistributedSimulationSyllabus2024JulySeptember.pdf b/MV3500DistributedSimulationSyllabus2024JulySeptember.pdf index 22f2b3bdf32037be46a53374023cb8921795c9e8..96622654d9e5ad6b13328ccca758f1e35c8b3e0d 100644 Binary files a/MV3500DistributedSimulationSyllabus2024JulySeptember.pdf and b/MV3500DistributedSimulationSyllabus2024JulySeptember.pdf differ diff --git a/assignments/README.md b/assignments/README.md index dda6f4963dc2297fe819068511b492ad995f8d5d..a113f3b7925ff46a3e5525fd8c608baf621fec84 100644 --- a/assignments/README.md +++ b/assignments/README.md @@ -1,17 +1,17 @@ -# Networked Graphics MV3500 Course Assignments using Netbeans +# Networked Graphics MV3500 Course Assignments using NetBeans ## Initialization and Refresh -To submit homework via Netbeans to the gitlab server you will first need to -clone a copy of the course repository at +To submit homework via NetBeans to the gitlab server you will first need to +use Git to clone a copy of the course repository at * https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500 -Use Netbeans to upload/update your homework assignments as follows: +Use NetBeans to upload/update your homework assignments as follows: 1. *context menu:* **Git > Remote > Pull from Upstream** to first always ensure you update your repository 1. *Making sure:* Did you perform step one and pull git to refresh your local version?! -1. Select file of interest in Netbeans tab for Files +1. Select file of interest in NetBeans tab for Files 1. *context menu:* **Refactor/Rename** and take spaces out of file name (gets wacky on various operating systems, email etc.) 1. Ensure Java classes and source files start with your last name 1. *context menu:* **Run file**(s) to test @@ -21,7 +21,7 @@ Use Netbeans to upload/update your homework assignments as follows: ## Adding and Editing Your Files -All MV3500 cohorts have source code collected under a common Netbeans project. +All MV3500 cohorts have source code collected under a common NetBeans project. 1. Find your current cohort src subdirectories, for example * [assignments / src / MV3500Cohort2024JulySeptember](src/MV3500Cohort2024JulySeptember) (we are here!) @@ -54,7 +54,7 @@ After committing and pushing, you can now verify that your files are been shared ## References -* [Netbeans](http://www.netbeans.org) and [Using Git Support](https://netbeans.apache.org/kb/docs/ide/git.html) with [tutorial video, version 8.2](https://www.youtube.com/watch?v=rs3QSq5hNf4) +* [NetBeans](http://www.netbeans.org) and [Using Git Support](https://netbeans.apache.org/kb/docs/ide/git.html) with [tutorial video, version 8.2](https://www.youtube.com/watch?v=rs3QSq5hNf4) * [GitLab Flavored Markdown (GFM)](https://docs.gitlab.com/ee/user/markdown.html) and [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet) * UML [Sequence diagram](https://en.wikipedia.org/wiki/Sequence_diagram) on Wikipedia * [Wireshark](https://www.wireshark.org) network protocol analyzer diff --git a/assignments/build.xml b/assignments/build.xml index 3135918eee4f35fb7a80c43ec8bcc205bfbeb119..a7d93fc88d00806f1ea2f28c79c6ce3102808f09 100644 --- a/assignments/build.xml +++ b/assignments/build.xml @@ -130,9 +130,9 @@ POSSIBILITY OF SUCH DAMAGE. </target> <!-- ensure backwards compatibility of produced jar to specified version of Java, though project itself may be higher --> - <property name="java.source" value="17"/><!-- LTS --> - <property name="java.target" value="17"/><!-- LTS --> - <property name="java.release" value="17"/><!-- LTS --><!-- simpler, less verbose than -source -target --> + <!-- <property name="java.source" value="21"/>LTS --> + <!-- <property name="java.target" value="21"/>LTS --> + <!-- <property name="java.release" value="21"/>LTS --><!-- simpler, less verbose than -source -target --> <property name="dist.javadoc.dir" value="dist/javadoc"/> <property name="javadoc.additionalparam" value=""/> @@ -144,7 +144,7 @@ POSSIBILITY OF SUCH DAMAGE. <property name="javadoc.nonavbar" value="false"/> <property name="javadoc.notree" value="false"/> <property name="javadoc.private" value="false"/> - <property name="javadoc.source" value="${java.source}"/> +<!--<property name="javadoc.source" value="${java.source}"/>--> <property name="javadoc.splitindex" value="true"/> <property name="javadoc.breakiterator" value="true"/> <property name="javadoc.use" value="true"/><!-- Create class and package usage pages --> @@ -171,13 +171,13 @@ POSSIBILITY OF SUCH DAMAGE. notree="${javadoc.notree}" Overview="src/overview.html" Private="${javadoc.private}" - source="${java.source}" Splitindex="${javadoc.splitindex}" Use="${javadoc.use}" useexternalfile="yes" verbose="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> + <!-- source="${java.source}" --> <classpath> <pathelement location="../lib/opendis7-full.jar"/> <pathelement location="../lib/open-dis_4.16.jar"/> diff --git a/assignments/nbproject/project.properties b/assignments/nbproject/project.properties index 9003d11a34aa62d496dd78e30b32d7bea504d908..acc52782ced4a372d91b7af887b79cca59e0ae1a 100644 --- a/assignments/nbproject/project.properties +++ b/assignments/nbproject/project.properties @@ -113,7 +113,7 @@ manifest.custom.codebase= manifest.custom.permissions= meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false -platform.active=default_platform +platform.active=JDK_22 project.licensePath=../license.txt run.classpath=\ ${javac.classpath}:\ diff --git a/assignments/nbproject/project.xml b/assignments/nbproject/project.xml index ec9c9401e07d97eb2d28c832cc9985585aeb9f06..f4711c4a46f519e15f88ca993b41da9231b32773 100644 --- a/assignments/nbproject/project.xml +++ b/assignments/nbproject/project.xml @@ -4,6 +4,7 @@ <configuration> <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> <name>Networked Graphics MV3500 assignments</name> + <explicit-platform explicit-source-supported="true"/> <source-roots> <root id="src.dir"/> </source-roots> diff --git a/assignments/src/MV3500Cohort2024JulySeptember/homework2/Bavlsik/BavlsikClient.java b/assignments/src/MV3500Cohort2024JulySeptember/homework2/Bavlsik/BavlsikClient.java index 94fdb5e9a4f38266a166be160b3ac3a896fe3143..3879e0d2cc5be948a0f1e07b62fd9ce60e78952e 100644 --- a/assignments/src/MV3500Cohort2024JulySeptember/homework2/Bavlsik/BavlsikClient.java +++ b/assignments/src/MV3500Cohort2024JulySeptember/homework2/Bavlsik/BavlsikClient.java @@ -8,11 +8,16 @@ import java.net.Socket; import java.util.Scanner; /** - * + * This client attempts to connect to a desired server. If the client is unable + * to connect then it exits the program. Enter 'quit' to the command line at any + * time to exit. * @author tbavlsik */ public class BavlsikClient { + /** + * Localhost address. + */ public final static String LOCALHOST = "0:0:0:0:0:0:0:1"; //Local host /** diff --git a/assignments/src/overview.html b/assignments/src/overview.html index f69d25fd87fabfebc9a7d4394296c564d6dd31ff..76a76b3ecc73a81aad4087b33e0c2c98aea832f9 100644 --- a/assignments/src/overview.html +++ b/assignments/src/overview.html @@ -5,7 +5,7 @@ <h1> Course Resources </h1> <p> <!-- Note that javadoc throws an incorrect error regarding title attribute, but resulting HTML works as expected --> - <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/README.md" target="_blank" title="Open-Dis Surfer Dude, Thanks Don McGregor!"><img src="OpenDisSurferDude.png" alt="Open-Dis Surfer Dude, Thanks Don McGregor!" style="float:right"/></a> + <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/README.md" target="_blank"><img src="OpenDisSurferDude.png" alt="Open-Dis Surfer Dude, Thanks Don McGregor!" style="float:right"/></a> <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments" target="_blank">Assignments</a>, <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/examples" target="_blank">examples</a>, and <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/presentations" target="_blank">presentations</a> diff --git a/build.properties b/build.properties new file mode 100644 index 0000000000000000000000000000000000000000..2d38b9f13c7e911590a334e2f995526a70a5c100 --- /dev/null +++ b/build.properties @@ -0,0 +1,35 @@ +# Created 23 AUG 2024 +product.shortname=viskit +viskit.dir=${product.shortname} +viskit.lib.dir=${viskit.dir}/lib + +opendis.jar=lib/opendis7-full.jar +extra.classpath=${opendis.jar} + +main.class=viskit.EventGraphAssemblyComboMain + +#assy.file=${basedir}/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/ArrivalProcessOpenDis7Assembly.xml +#assy.file=${basedir}/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/SimpleServerDis7Assembly.xml + +# Viskit run arguments +common.run.args=-Xmx256m \ + -Dswing.aatext=true + +win.run.args=${common.run.args} + +run.arg1=-Dawt.useSystemAAFontSettings=gasp +unix.run.args=${common.run.args} ${run.arg1} + +run.arg2=-Dapple.awt.graphics.UseQuartz=true \ + -Dapple.laf.useScreenMenuBar=true \ + -Dapple.awt.brushMetalLook=true \ + -Xdock:name=${product.shortname} \ + --add-exports java.desktop/com.apple.eawt=ALL-UNNAMED +mac.run.args=${common.run.args} ${run.arg2} + +# property used to identify Viskit config files +dot.viskit.dir=${user.home}/.${product.shortname} +c_app.xml=${viskit.dir}/configuration/c_app.xml +c_gui.xml=${viskit.dir}/configuration/c_gui.xml + +splash.image=${viskit.dir}/configuration/ViskitSplash2.png diff --git a/build.xml b/build.xml index 1fd203808b69852c5651e004a26061e01708d995..e79a8818f1f5a4bc22099346b5c464e005c8f0c9 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 1995-2023 held by the author(s). All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -41,11 +41,12 @@ POSSIBILITY OF SUCH DAMAGE. --> <project name="MV3500 Networked Graphics" default="all" basedir="."> <description>Build targets for NPS Networked Graphics MV3500</description> - + <!-- TODO add targets for project maintenance, testing and deployment - + <property name="specificationsDirectory" location="specifications"/> <import file="specifications/build.xml"/> --> + <property file="build.properties"/> <target name="versions" description="show tool versions and environment values"> <echo>ant -version</echo> @@ -74,7 +75,7 @@ POSSIBILITY OF SUCH DAMAGE. <echoproperties/> --> <echo message="==========================================="/> </target> - + <target name="all" depends="versions"> <ant dir="examples" target="clean"/> <ant dir="examples" target="jar"/> @@ -82,64 +83,63 @@ POSSIBILITY OF SUCH DAMAGE. <ant dir="assignments" target="jar"/> <antcall target="javadoc.all"/> </target> - + <target name="clean.all.pduLogs" description="clean autogenerated PDU capture logs"> <ant dir="assignments" target="clean.all.pduLogs"/> <ant dir="examples" target="clean.all.pduLogs"/> </target> <target name="javadoc.all"> - <ant dir="examples" target="view.opendis7.javadoc"/> - <ant dir="assignments" target="javadoc.custom"/> - <ant dir="examples" target="javadoc.custom"/> + <ant dir="assignments" target="javadoc.custom" useNativeBaseDir="true"/> + <ant dir="examples" target="javadoc.custom" useNativeBaseDir="true"/> </target> - + <target name="view.gitlab.nps.edu.MV3500" description="view MV3500 gitlab site in web browser (via Netbeans only)"> <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500"/> <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500"/> <!-- TODO implementation-independent approach if possible. other Ant approaches have to be customized for each OS --> </target> - + <target name="view.gitlab.nps.edu.MV3500.assignments" description="view MV3500 gitlab examples in web browser (via Netbeans only)"> <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/assignments"/> <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/assignments"/> </target> - + <target name="view.gitlab.nps.edu.MV3500.examples" description="view MV3500 gitlab examples in web browser (via Netbeans only)"> <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/examples"/> <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/examples"/> <!-- TODO implementation-independent approach if possible. other Ant approaches have to be customized for each OS --> </target> - + <target name="view.gitlab.nps.edu.MV3500.issues" description="view online issues in web browser (Netbeans only)"> <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/issues" /> <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/issues" /> <!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. --> <echo message="... for issue visibility, be sure to login" /> </target> - + <target name="view.gitlab.nps.edu.MV3500.specifications.README" description="view MV3500 gitlab examples in web browser (via Netbeans only)"> <echo message="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/specifications/README.md"/> <nbbrowse url="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/tree/master/specifications/README.md"/> </target> - + <target name="view.open-dis.github.com" description="view github open-dis site in web browser (via Netbeans only)"> <echo message="https://github.com/open-dis"/> <nbbrowse url="https://github.com/open-dis"/> </target> - + <target name="view.open-dis.github.com.opendis7-java" description="view github open-dis open-dis-java current build in web browser (via Netbeans only)"> <echo message="https://github.com/open-dis/opendis7-java"/> <nbbrowse url="https://github.com/open-dis/opendis7-java"/> </target> - + <target name="view.open-dis.github.com.opendis7-source-generator" description="view github open-dis opendis7-source-generator project in web browser (via Netbeans only)"> <echo message="https://github.com/open-dis"/> <nbbrowse url="https://github.com/open-dis"/> </target> - + <target name="update.opendis7.jar.from.local" description="update opendis7-java jar files from locally built project into lib directory"> - + <property name="opendis7-java.relative" value="../../x3d-github/opendis7-java/dist"/> <echo message="Copy ${opendis7-java.relative}/opendis7-full.jar to project lib/ subdirectory..."/> <!-- https://ant.apache.org/manual/Tasks/fail.html --> @@ -159,21 +159,21 @@ POSSIBILITY OF SUCH DAMAGE. <delete file="lib/opendis7-enumerations-classes.jar" verbose="false" failonerror="false"/> <delete file="lib/opendis7-enumerations-javadoc.jar" verbose="false" failonerror="false"/> <delete file="lib/opendis7-enumerations-source.jar" verbose="false" failonerror="false"/> - + <!-- replace latest version --> <delete file="lib/opendis7-full.jar" verbose="true" failonerror="false"/> <copy file="${opendis7-java.relative}/opendis7-full.jar" todir="lib" force="true" verbose="true" failonerror="true"/> - + <!-- <delete file="assignments/dist/lib/opendis7-full.jar" verbose="true" failonerror="false"/> <delete file="examples/dist/lib/opendis7-full.jar" verbose="true" failonerror="false"/> <copy file="${opendis7-java.relative}/opendis7-full.jar" todir="assignments/dist/lib" force="true" verbose="true" failonerror="true"/> <copy file="${opendis7-java.relative}/opendis7-full.jar" todir="examples/dist/lib" force="true" verbose="true" failonerror="true"/> - + <copy file="${opendis7-java.relative}/opendis7-enumerations-classes.jar" todir="lib" force="true" verbose="true" failonerror="true"/> <copy file="${opendis7-java.relative}/opendis7-enumerations-source.jar" todir="lib" force="true" verbose="true" failonerror="true"/> <copy file="${opendis7-java.relative}/opendis7-enumerations-javadoc.jar" todir="lib" force="true" verbose="true" failonerror="true"/> - + <fail message="opendis7-pdus-classes.jar not found"> <condition> <not> @@ -183,8 +183,8 @@ POSSIBILITY OF SUCH DAMAGE. </not> </condition> </fail> - - + + <copy file="${opendis7-java.relative}/opendis7-pdus-classes.jar" todir="lib" force="true" verbose="true" failonerror="true"/> <copy file="${opendis7-java.relative}/opendis7-pdus-javadoc.jar" todir="lib" force="true" verbose="true" failonerror="true"/> <copy file="${opendis7-java.relative}/opendis7-pdus-source.jar" todir="lib" force="true" verbose="true" failonerror="true"/> @@ -192,7 +192,7 @@ POSSIBILITY OF SUCH DAMAGE. <!-- <delete file="lib/opendis7-classes.jar" verbose="true" failonerror="false"/> prior name --> <!-- <delete file="lib/opendis7-javadoc.jar" verbose="true" failonerror="false"/> prior name --> <!-- <delete file="lib/opendis7-source.jar" verbose="true" failonerror="false"/> prior name --> - + </target> <property name="gitlab.nps.edu.MV3500.lib" value="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/lib"/> @@ -218,11 +218,11 @@ POSSIBILITY OF SUCH DAMAGE. dest="lib" verbose="true" usetimestamp="true"/> --> </target> - + <target name="update.opendis7.jar.from.maven" description="update opendis7.jar in project lib directory"> <echo message="TODO retrieve from Maven published repository once available"/> </target> - + <property name="gitlab.nps.edu.MV3302.lib" value="https://gitlab.nps.edu/abuss/MV3302ClassCode/-/tree/master/lib/Simkit"/> <target name="update.simkit.jar.from.gitlab" description="Update local opendis7 .jar files in project lib directory"> @@ -237,5 +237,94 @@ POSSIBILITY OF SUCH DAMAGE. <get src="https://gitlab.nps.edu/abuss/MV3302ClassCode/-/raw/master/lib/Simkit/simkit-doc.zip" dest="lib" verbose="true" usetimestamp="true"/> </target> + + <!-- Viskit properties --> + <target name="platformInitialize" depends="platformType"/> + <target name="platformType"> + <condition property="isWin" > + <os family="windows"/> + </condition> + <condition property="isMac" > + <os family="mac"/> + </condition> + <!-- Based on Apache Ant user-manual example --> + <condition property="isUnix"> + <and> + <os family="unix"/> + + <not> + <equals arg1="${os.name}" arg2="Mac OS X"/> + </not> + + </and> + </condition> + </target> + <target name="initWin" if="isWin"> + <property name="run.args" value="${win.run.args}"/> + </target> + <target name="initUnix" if="isUnix"> + <property name="run.args" value="${unix.run.args}"/> + </target> + <target name="initMac" if="isMac"> + <property name="run.args" value="${mac.run.args}"/> + </target> + <target name="initializeAll" depends="platformInitialize,initWin,initUnix,initMac"/> + <target name="set.classpath" depends="initializeAll"> + <path id="runtime.classpath"> + <fileset dir="${viskit.lib.dir}"> + <include name="**/*.jar"/> + </fileset> + <pathelement path="${extra.classpath}"/> + </path> + <!--<echo message="runtime.classpath=${toString:runtime.classpath}"/>--> + </target> + + <target name="run.viskit" depends="set.classpath" description="Start the Visual Simikit (viskit) DES Authoring Tool on any O/S"> + <splash imageurl="file:${basedir}/${splash.image}" + useproxy="true" + showduration="5000"/> + <java classname="${main.class}" + classpathref="runtime.classpath" + dir="${viskit.dir}" + fork="true"> + <jvmarg line="${run.args}"/> + <arg value="${assy.file}"/> + </java> + </target> + + <target name="clean.all.viskit.logs" description="clean autogenerated PDU capture and Viskit generated logs"> + <delete dir="${viskit.dir}/logs"/> + <delete dir="${viskit.dir}/pduLog"/> + </target> + + <target name="reset.viskit.MV3500" description="initialize user preferences for Viskit MV3500"> + <echo message="Warning: under development"/> + <echo message="Reset MV3500 user's Viskit configuration files in ${dot.viskit.dir}"/> + <delete includeemptydirs="yes" dir="${dot.viskit.dir}"/> + <!-- repopulute with defaults + <mkdir dir="${dot.viskit.dir}"/> --> + <copy verbose="true" tofile="${dot.viskit.dir}/c_app.xml" file="c_app.ViskitDefaultMV3500.xml"/> + <copy todir ="${dot.viskit.dir}" file="${c_gui.xml}"/> + </target> + + <target name="reset.viskit.DefaultProject" description="initialize user preferences for Viskit DefaultProject"> + <echo message="Warning: under development"/> + <echo message="Reset MV3500 user's Viskit configuration files in ${dot.viskit.dir}"/> + <delete includeemptydirs="yes" dir="${dot.viskit.dir}"/> + <!-- repopulute with defaults + <mkdir dir="${dot.viskit.dir}"/> --> + <copy verbose="true" tofile="${dot.viskit.dir}/c_app.xml" file="c_app.ViskitDefaultProject.xml"/> + <copy todir ="${dot.viskit.dir}" file="${c_gui.xml}"/> + </target> + + <target name="reset.viskit" description="clear an out of synch configuration and metadata directory - only when necessary"> + <echo message="Reset user's Viskit configuration files in ${dot.viskit.dir}"/> + <delete includeemptydirs="yes" dir="${dot.viskit.dir}"/> + <!-- repopulute with defaults + <mkdir dir="${dot.viskit.dir}"/> --> + <copy todir="${dot.viskit.dir}" file="${c_app.xml}"/> + <copy todir="${dot.viskit.dir}" file="${c_gui.xml}"/> + </target> + </project> \ No newline at end of file diff --git a/c_app.ViskitDefaultMV3500.xml b/c_app.ViskitDefaultMV3500.xml new file mode 100644 index 0000000000000000000000000000000000000000..c53d3de308caa856d21b7c9ee3bb07a3954af924 --- /dev/null +++ b/c_app.ViskitDefaultMV3500.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Viskit application configuration file c_app.xml --> +<!-- Programming note: values in this file are retrieved by keys such as 'app.beanshell.warning' --> +<!-- Programming note: the root element name is ignored when assembling keys --> +<ViskitConfig> + <app> + <beanshell> + <warning>true</warning> + </beanshell> + <mainframe> + <size h="680" w="930" /> + </mainframe> + <projecthome> + <!-- These two attributes MUST always be at least zero-length Strings --> + <!-- DefaultProject is included in this template for convenience + <path dir= "./viskit/MyViskitProjects" />--> + <path dir="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/examples/src" /> + <name value="ViskitOpenDis7Examples" /> + </projecthome> + <tabs> + <EventGraphEditor visible="true" /> + <AssemblyEditor visible="true" /> + <AssemblyRun visible="true" /> + <DesignOfExperiments visible="false" /> + <ClusterRun visible="false" /> + <AnalystReport visible="false" /> + </tabs> + <debug>false</debug> + </app> + <history> + <ProjectEditor> + <Recent> + <!-- + <Project value="./examples/src/ViskitOpenDis7Examples" /> + <Project value="./viskit/MyViskitProjects/DefaultProject" /> + --> + <Project value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject" /> + <Project value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/examples/src/ViskitOpenDis7Examples"/> + </Recent> + </ProjectEditor> + <Cluster> + <Account last="true" password="" port="4444" server="wipeout.hpr.nps.edu" username="" /> + </Cluster> + <AssemblyEditor> + <Recent> + <AssemblyFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/ArrivalProcessOpenDis7Assembly.xml"/> + <AssemblyFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/SimpleServerDis7Assembly.xml"/> + </Recent> + </AssemblyEditor> + <EventGraphEditor> + <Recent> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/examples/src/ViskitOpenDis7Examples/EventGraphs/dis7/ArrivalProcessOpenDis7.xml"/> + </Recent> + </EventGraphEditor> + </history> +</ViskitConfig> + diff --git a/c_app.ViskitDefaultProject.xml b/c_app.ViskitDefaultProject.xml new file mode 100644 index 0000000000000000000000000000000000000000..7cfee312ce15b9d64988e2038f1c371317f56bee --- /dev/null +++ b/c_app.ViskitDefaultProject.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Viskit application configuration file c_app.xml --> +<!-- Programming note: values in this file are retrieved by keys such as 'app.beanshell.warning' --> +<!-- Programming note: the root element name is ignored when assembling keys --> +<ViskitConfig> + <app> + <beanshell> + <warning>true</warning> + </beanshell> + <mainframe> + <size h="680" w="930" /> + </mainframe> + <projecthome> + <!-- These two attributes MUST always be at least zero-length Strings --> + <!-- DefaultProject is included in this template for convenience + <path dir= "./viskit/MyViskitProjects" />--> + <path dir="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects" /> + <name value="DefaultProject" /> + </projecthome> + <tabs> + <EventGraphEditor visible="true" /> + <AssemblyEditor visible="true" /> + <AssemblyRun visible="true" /> + <DesignOfExperiments visible="false" /> + <ClusterRun visible="false" /> + <AnalystReport visible="false" /> + </tabs> + <debug>false</debug> + </app> + <history> + <ProjectEditor> + <Recent> + <!-- + <Project value="./examples/src/ViskitOpenDis7Examples" /> + <Project value="./viskit/MyViskitProjects/DefaultProject" /> + <Project value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject" /> + --> + <Project value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject" /> + <Project value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/examples/src/ViskitOpenDis7Examples"/> + </Recent> + </ProjectEditor> + <Cluster> + <Account last="true" password="" port="4444" server="wipeout.hpr.nps.edu" username="" /> + </Cluster> + <AssemblyEditor> + <Recent> + <AssemblyFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ArrayTesterAssembly.xml" /> + <AssemblyFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/InventoryModelAssembly.xml" /> + <AssemblyFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerAssembly3.xml" /> + <AssemblyFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerWithRenegesAssembly.xml" /> + <AssemblyFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/TestServerGenericAssembly.xml" /> + </Recent> + </AssemblyEditor> + <EventGraphEditor> + <Recent> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrayTester.xml" /> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrivalProcess.xml" /> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/InventoryModel.xml" /> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleServer.xml" /> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/Creator.xml" /> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerWithReneges.xml" /> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/EntityCreator.xml" /> + <EventGraphFile value="C:/x3d-nps-gitlab/NetworkedGraphicsMV3500/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerGeneric.xml" /> + </Recent> + </EventGraphEditor> + </history> +</ViskitConfig> + diff --git a/examples/build.xml b/examples/build.xml index 79c4849bf30c42f1f4c24d95c4141e34895d0afc..c3edb7fd9fb2f56c7f074da12735b35b06b94bf2 100644 --- a/examples/build.xml +++ b/examples/build.xml @@ -134,9 +134,9 @@ POSSIBILITY OF SUCH DAMAGE. </target> <!-- ensure backwards compatibility of produced jar to specified version of Java, though project itself may be higher --> - <property name="java.source" value="17"/><!-- LTS --> - <property name="java.target" value="17"/><!-- LTS --> - <property name="java.release" value="17"/><!-- LTS --><!-- simpler, less verbose than -source -target --> + <!-- <property name="java.source" value="21"/>LTS --> + <!-- <property name="java.target" value="21"/>LTS --> + <!-- <property name="java.release" value="21"/>LTS --><!-- simpler, less verbose than -source -target --> <property name="dist.javadoc.dir" value="dist/javadoc"/> <property name="javadoc.additionalparam" value=""/> @@ -148,7 +148,7 @@ POSSIBILITY OF SUCH DAMAGE. <property name="javadoc.nonavbar" value="false"/> <property name="javadoc.notree" value="false"/> <property name="javadoc.private" value="false"/> - <property name="javadoc.source" value="${java.source}"/> +<!--<property name="javadoc.source" value="${java.source}"/>--> <property name="javadoc.splitindex" value="true"/> <property name="javadoc.breakiterator" value="true"/> <property name="javadoc.use" value="true"/><!-- Create class and package usage pages --> @@ -176,13 +176,13 @@ POSSIBILITY OF SUCH DAMAGE. notree="${javadoc.notree}" Overview="src/overview.html" Private="${javadoc.private}" - source="${java.source}" Splitindex="${javadoc.splitindex}" Use="${javadoc.use}" useexternalfile="yes" verbose="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> + <!-- source="${java.source}" --> <classpath> <pathelement location="../lib/opendis7-full.jar"/> <pathelement location="../lib/open-dis_4.16.jar"/> @@ -207,5 +207,20 @@ POSSIBILITY OF SUCH DAMAGE. <nbbrowse url="https://savage.nps.edu/opendis7-java/javadoc" /> <!-- TODO implementation-independent approach if possible, but note that other Ant approaches usually have to be customized for each OS. --> </target> + + <target name="run.opendis.helper" depends="jar" description="Test run our OpenDisHelper"> + <java classpath="${viskit.proj.lib.dir}/${dist.name}.jar" classname="${opendis.helper}" fork="true"> + <classpath path="${file.reference.simkit.jar}"/> + <classpath path="${file.reference.opendis7-full.jar}"/> + </java> + </target> + + <target name="-post-jar"> + <copy todir="${viskit.proj.lib.dir}"> + <fileset dir="${dist.dir}"> + <include name="${dist.name}.jar"/> + </fileset> + </copy> + </target> </project> diff --git a/examples/nbproject/project.properties b/examples/nbproject/project.properties index bfa08a8d90d76ef73503d1b02ed5df067fb6f5dd..546aa0b56deba63200d7b17bfc738d729255093e 100644 --- a/examples/nbproject/project.properties +++ b/examples/nbproject/project.properties @@ -1,117 +1,121 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.processors.list= -annotation.processing.run.all.processors=true -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -application.desc=Example programs provided as part of NPS course Networked Graphics MV3500. This course is an introduction to network communications in simulation applications. Topics include an introduction to the TCP/IP protocol stack; TCP/IP socket communications, including TCP, UDP, and multicast; and protocol design issues, with emphasis on Distributed Interactive Simulation (DIS) Protocol and High Level Architecture (HLA). Course emphasis is on creation and testing of network programming network code and web-browser applications. -application.homepage=https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/examples -application.splash=..\\..\\NetworkedGraphicsMV3500\\documentation\\images\\OpenDisSurferDude.png -application.title=NPS Networked Graphics MV3500 examples -application.vendor=Don Brutzman -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -# Uncomment to specify the preferred debugger connection transport: -#debug.transport=dt_socket -debug.classpath=\ - ${run.classpath} -debug.modulepath=\ - ${run.modulepath} -debug.test.classpath=\ - ${run.test.classpath} -debug.test.modulepath=\ - ${run.test.modulepath} -# Files in build.classes.dir which should be excluded from distribution jar -dist.archive.excludes= -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/Networked_Graphics_MV3500_examples.jar -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.dis-enums-1.3.jar=../lib/dis-enums-1.3.jar - -file.reference.opendis7-full.jar=../lib/opendis7-full.jar -file.reference.open-dis_4.16.jar=../lib/open-dis_4.16.jar -file.reference.simkit-doc.zip=../lib/simkit-doc.zip -file.reference.simkit-src.zip=../lib/simkit-src.zip -file.reference.simkit.jar=../lib/simkit.jar -#file.reference.opendis7-enumerations-classes.jar=../lib/opendis7-enumerations-classes.jar -#file.reference.opendis7-pdus-classes.jar=../lib/opendis7-pdus-classes.jar -includes=** -jar.compress=false -javac.classpath=\ - ${file.reference.opendis7-full.jar}:\ - ${file.reference.open-dis_4.16.jar}:\ - ${file.reference.dis-enums-1.3.jar}:\ - ${file.reference.simkit.jar}:\ - ${file.reference.simkit-doc.zip}:\ - ${file.reference.simkit-src.zip} -# ${file.reference.opendis7-enumerations-classes.jar}:\ -# ${file.reference.opendis7-pdus-classes.jar}:\ - -# Space-separated list of extra javac options -javac.compilerargs=-Xlint:deprecation -Xlint:unchecked -javac.deprecation=false -javac.external.vm=true -javac.modulepath= -javac.processormodulepath= -javac.processorpath=\ - ${javac.classpath} -javac.source=22 -javac.target=22 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.modulepath=\ - ${javac.modulepath} -javac.test.processorpath=\ - ${javac.test.classpath} -javadoc.additionalparam=-header "NPS Networked Graphics MV3500 Examples" -javadoc.author=true -javadoc.encoding=${source.encoding} -javadoc.html5=false -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -#javadoc.reference.opendis7-enumerations-classes.jar=../lib/opendis7-enumerations-javadoc.jar -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle=MV3500 Examples -jlink.launcher=false -jlink.launcher.name=Networked_Graphics_MV3500_examples -main.class=TcpExamples.TcpExample1Telnet -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=JDK_22 -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project. -# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. -# To set system properties for unit tests define test-sys-prop.name=value: -run.jvmargs= -run.modulepath=\ - ${javac.modulepath} -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -run.test.modulepath=\ - ${javac.test.modulepath} -source.encoding=UTF-8 -#source.reference.opendis7-enumerations-classes.jar=../lib/opendis7-enumerations-source.jar -src.dir=src -src.src.dir=otherProjects\\DisDemo\\src -src.src2.dir=otherProjects\\DisShooting\\src -src.src3.dir=otherProjects\\WebSocketGateway\\src -#src.src4.dir=otherProjects\\BasicServletDemo\\src +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.desc=Example programs provided as part of NPS course Networked Graphics MV3500. This course is an introduction to network communications in simulation applications. Topics include an introduction to the TCP/IP protocol stack; TCP/IP socket communications, including TCP, UDP, and multicast; and protocol design issues, with emphasis on Distributed Interactive Simulation (DIS) Protocol and High Level Architecture (HLA). Course emphasis is on creation and testing of network programming network code and web-browser applications. +application.homepage=https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/examples +application.splash=..\\..\\NetworkedGraphicsMV3500\\documentation\\images\\OpenDisSurferDude.png +application.title=NPS Networked Graphics MV3500 examples +application.vendor=Don Brutzman +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.name=Networked_Graphics_MV3500_examples +dist.jar=${dist.dir}/${dist.name}.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +project.licensePath=../license.txt +viskit.proj.dir=ViskitOpenDis7Examples +viskit.proj.lib.dir=src/${viskit.proj.dir}/lib +opendis.helper=SimkitOpenDis7Examples.run.OpenDisHelper +excludes=ViskitOpenDis7Examples/ +file.reference.dis-enums-1.3.jar=../lib/dis-enums-1.3.jar +file.reference.opendis7-full.jar=../lib/opendis7-full.jar +file.reference.open-dis_4.16.jar=../lib/open-dis_4.16.jar +file.reference.simkit-doc.zip=../lib/simkit-doc.zip +file.reference.simkit-src.zip=../lib/simkit-src.zip +file.reference.simkit.jar=../lib/simkit.jar +#file.reference.opendis7-enumerations-classes.jar=../lib/opendis7-enumerations-classes.jar +#file.reference.opendis7-pdus-classes.jar=../lib/opendis7-pdus-classes.jar +includes=**/*.java +jar.compress=false +javac.classpath=\ + ${file.reference.opendis7-full.jar}:\ + ${file.reference.open-dis_4.16.jar}:\ + ${file.reference.dis-enums-1.3.jar}:\ + ${file.reference.simkit.jar}:\ + ${file.reference.simkit-doc.zip}:\ + ${file.reference.simkit-src.zip} +# ${file.reference.opendis7-enumerations-classes.jar}:\ +# ${file.reference.opendis7-pdus-classes.jar}:\ + +# Space-separated list of extra javac options +javac.compilerargs=-Xlint:deprecation -Xlint:unchecked +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=22 +javac.target=22 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam=-header "NPS Networked Graphics MV3500 Examples" +javadoc.author=true +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +#javadoc.reference.opendis7-enumerations-classes.jar=../lib/opendis7-enumerations-javadoc.jar +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle=MV3500 Examples +jlink.launcher=false +jlink.launcher.name=Networked_Graphics_MV3500_examples +main.class=TcpExamples.TcpExample1Telnet +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +#source.reference.opendis7-enumerations-classes.jar=../lib/opendis7-enumerations-source.jar +src.dir=src +src.src.dir=otherProjects\\DisDemo\\src +src.src2.dir=otherProjects\\DisShooting\\src +src.src3.dir=otherProjects\\WebSocketGateway\\src +#src.src4.dir=otherProjects\\BasicServletDemo\\src diff --git a/examples/nbproject/project.xml b/examples/nbproject/project.xml index d7c8e3fd3bc7ee7e746750956a36a82fa1034338..bd4589c403c0307b9edb0d25126b2a5fe03ae4bf 100644 --- a/examples/nbproject/project.xml +++ b/examples/nbproject/project.xml @@ -4,6 +4,7 @@ <configuration> <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> <name>Networked Graphics MV3500 examples</name> + <explicit-platform explicit-source-supported="true"/> <source-roots> <root id="src.dir"/> <root id="src.src.dir"/> diff --git a/examples/src/OpenDis7Examples/AllPduReceiver.java b/examples/src/OpenDis7Examples/AllPduReceiver.java index 424ab01244d066a36803ca2b3ae0e425b4eb07cf..437b51d4413435b2b725a341e2aea3c08e864047 100644 --- a/examples/src/OpenDis7Examples/AllPduReceiver.java +++ b/examples/src/OpenDis7Examples/AllPduReceiver.java @@ -52,7 +52,7 @@ public class AllPduReceiver } else { - System.out.println("Usage: AllPduReceiver <multicast group> <port>"); + System.out.println("Usage: AllPduReceiver <multicast group address> <port>"); System.out.println("Default: AllPduReceiver " + DEFAULT_MULTICAST_ADDRESS + " " + DEFAULT_MULTICAST_PORT); multicastSocket = new MulticastSocket(DEFAULT_MULTICAST_PORT); multicastInetAddress = InetAddress.getByName(DEFAULT_MULTICAST_ADDRESS); diff --git a/examples/src/OpenDis7Examples/AllPduSender.java b/examples/src/OpenDis7Examples/AllPduSender.java index 441f9c1006c4c88eb6039de6f44e01a8e09b7594..57abbb763495462e7a8800c378f16af1be7cd9cb 100755 --- a/examples/src/OpenDis7Examples/AllPduSender.java +++ b/examples/src/OpenDis7Examples/AllPduSender.java @@ -541,13 +541,13 @@ public class AllPduSender if (args.length == 2) { - System.out.println("Usage: AllPduSender <multicast group> <port>"); + System.out.println("Usage: AllPduSender <multicast group address> <port>"); System.out.println("Actual: AllPduSender " + multicastInetAddress.getHostAddress() + " " + port); allPduSender = new AllPduSender(args[0], Integer.parseInt(args[1])); } else { - System.out.println("Usage: AllPduSender <multicast group> <port>"); + System.out.println("Usage: AllPduSender <multicast group address> <port>"); System.out.println("Default: AllPduSender " + DEFAULT_MULTICAST_ADDRESS + " " + DEFAULT_MULTICAST_PORT); allPduSender = new AllPduSender(DEFAULT_MULTICAST_ADDRESS, DEFAULT_MULTICAST_PORT); } diff --git a/examples/src/SimkitOpenDis7Examples/ArrivalProcessOpenDis7.java b/examples/src/SimkitOpenDis7Examples/ArrivalProcessOpenDis7.java index b4b496ec0c396fa655dc46c15400570433aa0e8f..d4832f8d0debe544ef6bcef56b921cfab72bf1a8 100644 --- a/examples/src/SimkitOpenDis7Examples/ArrivalProcessOpenDis7.java +++ b/examples/src/SimkitOpenDis7Examples/ArrivalProcessOpenDis7.java @@ -20,7 +20,8 @@ import simkit.random.RandomVariate; */ public class ArrivalProcessOpenDis7 extends SimEntityBase { - private final DisChannel disChannel = new DisChannel(); + /** Not a sim parameter */ + private final DisChannel disChannel; /** * Generates interarrival times @@ -31,16 +32,6 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase { * State variable that counts the number of Arrival events */ protected int numberArrivals; - - /** Initialize channel setup for OpenDis7 and report a test PDU */ - private void initializeDisChannel() - { - disChannel.setUpNetworkInterface(); - disChannel.printlnTRACE ("disChannel.getNetworkAddress()=" + disChannel.getNetworkAddress() + - ", getNetworkPort()=" + disChannel.getNetworkPort()); - - disChannel.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized"); - } /** * Instantiate an ArrivalProcess with the given interarrivalTimeGenerator @@ -49,8 +40,8 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase { * times */ public ArrivalProcessOpenDis7(RandomVariate interarrivalTimeGenerator) { + this(); this.interarrivalTimeGenerator = interarrivalTimeGenerator; - initializeDisChannel(); } /** @@ -59,7 +50,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase { * explicit call to its setter method. */ public ArrivalProcessOpenDis7() { - initializeDisChannel(); + disChannel = new DisChannel(); } /** @@ -69,6 +60,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase { public void reset() { super.reset(); numberArrivals = 0; + initializeDisChannel(); } /** @@ -129,4 +121,14 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase { public DisChannel getDisChannel() { return disChannel; } + + /** Initialize channel setup for OpenDis7 and report a test PDU */ + private void initializeDisChannel() + { + disChannel.setUpNetworkInterface(); + disChannel.printlnTRACE ("disChannel.getNetworkAddress()=" + disChannel.getNetworkAddress() + + ", getNetworkPort()=" + disChannel.getNetworkPort()); + + disChannel.sendCommentPdu(VariableRecordType.OTHER, getClass().getName() + " initialized"); + } } diff --git a/examples/src/SimkitOpenDis7Examples/README.md b/examples/src/SimkitOpenDis7Examples/README.md index 5bb6cc0e3b210f02238669008be1839d26146702..fffbb566f2a9e79df29768f6f246430bb63054b9 100644 --- a/examples/src/SimkitOpenDis7Examples/README.md +++ b/examples/src/SimkitOpenDis7Examples/README.md @@ -1,13 +1,25 @@ -# Simkit DIS Examples +# MV3500 Simkit Viskit DIS Examples -[This directory](https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/examples/src/SimkitOpenDis7Examples) includes simple Simkit programs which are getting modified to -utilize opendis7-java libraries for PDU output. +<!-- TODO rename directory SimkitViskitOpenDis7Examples --> +<!-- https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/examples/src/SimkitOpenDis7Examples/README.md --> + +*Simkit* is a powerful tool for modeling and simulation that can be networked +with other applications by integrating use of the +Distributed Interactive Simulation (DIS) protocol. +This directory includes simple Simkit programs which are getting modified to +utilize [opendis7-java](https://savage.nps.edu/opendis7-java) libraries for PDU output. + +*Viskit* is a visual editor for authoring Simkit event graphs and simulation assemblies. +Models are authored visually and saved as XML, which in turn generates Simkit Java code. +This tool is newly restored and we are now building examples that integrate +DIS capabilities with Simkit. ## Design Goals * Integrate code to share state changes from Simkit entities as DIS PDU messages. * Establish reference examples with corresponding output logs for test confirmation. -* Build interoperability examples for distributed simulation using Simkit, DIS and X3D. +* Build interoperability examples for distributed simulation using Simkit, Viskit, DIS and X3D. +* Continue evolution of [Viskit tool](https://gitlab.nps.edu/Savage/viskit) and integrated builds. ## Example Programs @@ -39,10 +51,12 @@ c. Two Crane Berths * Buss, Arnold, [Component Based Simulation Modeling with Simkit](documentation/BussComponentBasedSimulationModelingSimkitWintersim2002.pdf), Proceedings of the 2002 Winter Simulation Conference. * [Discrete Event Simulation Modeling](documentation/Discrete Event Simulation Modeling.pdf) manual for Simkit -* https://github.com/ahbuss/Simkit +* [Github: Simkit](https://github.com/ahbuss/Simkit) * https://gitlab.nps.edu/abuss/MV3302ClassCode * [MV3302: Introduction to Discrete Event Simulation Modeling (SP22_1_AB)](https://cle.nps.edu/portal/site/7c6b3539-58e4-4640-9551-ab03f8629e3c) in NPS Sakai * [MV3302 > Resources > Handouts](https://cle.nps.edu/portal/site/7c6b3539-58e4-4640-9551-ab03f8629e3c/tool/7f0dea2b-fa42-4bed-8c38-c67ce9f56582?panel=Main) +* [Simkit Quick Reference](documentation/SimkitQuickReference.docx) +* [Viskit demo video](https://savage.nps.edu/videos/Viskit-demo-2023MAR4.mp4) and [info](https://savage.nps.edu/videos/Viskit-demo-info-2023MAR4.mp4) ## TODO diff --git a/examples/src/SimkitOpenDis7Examples/TwoCraneBerthsOpenDis7.java b/examples/src/SimkitOpenDis7Examples/TwoCraneBerthsOpenDis7.java index a6deb8fa55631a010b7c98923c348605b70dccd9..9170fee823c46ef39af5e583ac10f699130898ee 100644 --- a/examples/src/SimkitOpenDis7Examples/TwoCraneBerthsOpenDis7.java +++ b/examples/src/SimkitOpenDis7Examples/TwoCraneBerthsOpenDis7.java @@ -18,7 +18,7 @@ import simkit.SimEntityBase; * @see <a href="run/RunTwoCranesBerthOpenDis7Log.txt" target="_blank">RunTwoCranesBerthOpenDis7Log.txt</a> * @see <a href="TwoCraneBerthsAssignment05.docx" target="_blank">TwoCraneBerthsAssignment05.docx</a> * @see <a href="TwoCraneBerthsAssignment05Solution.docx" target="_blank">TwoCraneBerthsAssignment05Solution.docx</a> - * @author abuss@nps.edu@nps.edu + * @author abuss@nps.edu * @author brutzman@nps.edu */ public class TwoCraneBerthsOpenDis7 extends SimEntityBase @@ -344,7 +344,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase berth.remove(ship); firePropertyChange("berth", oldBerth, getBerth()); - if (queue.size() > 0) { + if (!queue.isEmpty()) { waitDelay("StartUnloadingOneCrane", 0.0, Priority.HIGH); } diff --git a/examples/src/SimkitOpenDis7Examples/documentation/Discrete Event Simulation Modeling.pdf b/examples/src/SimkitOpenDis7Examples/documentation/Discrete Event Simulation Modeling.pdf index 529b1ed191932d95269a4471d6fb0ed5c7ca3995..13eca24db967ef92fa894582513f25d094790ac2 100644 Binary files a/examples/src/SimkitOpenDis7Examples/documentation/Discrete Event Simulation Modeling.pdf and b/examples/src/SimkitOpenDis7Examples/documentation/Discrete Event Simulation Modeling.pdf differ diff --git a/examples/src/SimkitOpenDis7Examples/run/OpenDisHelper.java b/examples/src/SimkitOpenDis7Examples/run/OpenDisHelper.java new file mode 100644 index 0000000000000000000000000000000000000000..0febac3f0235a08a978e364d68d515b8e59f4a01 --- /dev/null +++ b/examples/src/SimkitOpenDis7Examples/run/OpenDisHelper.java @@ -0,0 +1,455 @@ +/** + * Copyright (c) 2008-2023, MOVES Institute, Naval Postgraduate School (NPS). All rights reserved. + * This work is provided under a BSD open-source license, see project license.html or license.txt + * @author brutzman@nps.edu + */ +package SimkitOpenDis7Examples.run; + +//import edu.nps.moves.dis7.entities.swe.platform.surface._001Poseidon; +import edu.nps.moves.dis7.entities.swe.platform.surface._002Triton; +import edu.nps.moves.dis7.entities.usa.platform.air.ScanEagleA15; +import edu.nps.moves.dis7.enumerations.*; +import edu.nps.moves.dis7.pdus.*; +import edu.nps.moves.dis7.utilities.DisChannel; +import edu.nps.moves.dis7.utilities.PduFactory; + +import java.nio.charset.Charset; +import java.time.LocalDateTime; +import java.util.logging.Level; +import java.util.logging.Logger; + +import simkit.SimEntityBase; + +/** The OpenDisHelper is meant to be a transmitter/recorder of DIS PDUs in a DES environment + * + * Based on: NetworkedGraphicsMV3500/examples/src/OpenDis7Examples/ExampleSimulationProgram.java + * + * @author <a href="mailto:tdnorbra@nps.edu?subject=OpenDis7Examples.OpenDisHelper">Terry Norbraten, NPS MOVES</a> + */ +public class OpenDisHelper extends SimEntityBase +{ + /* **************************** infrastructure code, modification is seldom needed ************************* */ + + /** DIS channel defined by network address/port combination includes multiple utility capabilities */ + protected DisChannel disChannel; + /** Factory object used to create new PDU instances */ + protected PduFactory pduFactory; + /** ESPDU for entity 1 */ + protected EntityStatePdu entityStatePdu_1; + /** ESPDU for entity 2 */ + protected EntityStatePdu entityStatePdu_2; + /** FirePdu for entity 1 first weapon (if any) */ + protected FirePdu firePdu_1a; + /** FirePdu for entity 1 second weapon (if any) */ + protected FirePdu firePdu_1b; + /** MunitionDescriptor for these weapons */ + protected MunitionDescriptor munitionDescriptor1; + + private String descriptor; + /** seconds per loop for real-time or simulation execution */ + private double simulationTimeStepDuration; // seconds TODO encapsulate + /** initial simulation time in seconds */ + private double simulationTimeInitial; + /** current simulation time in seconds */ + private double simulationTimeSeconds; + /** Maximum number of simulation loops */ + private final int MAX_LOOP_COUNT; + + private String narrativeMessage1; + private String narrativeMessage2; + private String narrativeMessage3; + + // hey programmer, what other state do you want? this is a good place to declare it... + + /** + * Constructor to create an instance of this class. + * Design goal: additional built-in initialization conveniences can go here + * to keep your efforts focused on the runSimulation() method. + */ + // base constructor is not invoked automatically by other constructors + // https://stackoverflow.com/questions/581873/best-way-to-handle-multiple-constructors-in-java + public OpenDisHelper() + { + super(); + OpenDisHelper.this.setDescriptor(this.getClass().getSimpleName()); + simulationTimeStepDuration = 1.0d; + simulationTimeSeconds = simulationTimeInitial = 0.0d; + MAX_LOOP_COUNT = 4; + initialize(); + } + /** + * Constructor to create an instance of this class. + * @param newDescriptor describes this program, useful for logging and debugging + */ + public OpenDisHelper(String newDescriptor) + { + this(); + OpenDisHelper.this.setDescriptor(newDescriptor); + } + /** + * Utility Constructor that allows your example simulation program to override default network address and port + * @param address network address to use + * @param port corresponding network port to use (> -1) + */ + public OpenDisHelper(String address, int port) + { + this(); + + if (address != null && !address.isBlank()) + OpenDisHelper.this.setAddress(address); + + if (port > -1) + OpenDisHelper.this.setPort(port); + } + + /** Initialize channel setup for OpenDis7 and report a test PDU + * @see initializeDisChannel + * @see initializeSimulationEntities + */ + private void initialize() + { + initializeDisChannel(); // must come first, uses PduFactory + + initializeSimulationEntities(); // set unchanging parameters + + disChannel.join(); // TODO further functionality expected + +// String timeStepMessage = "Simulation timestep duration " + getSimulationTimeStepDuration() + " seconds"; +// disChannel.sendCommentPdu(simulationTimeSeconds, DisChannel.COMMENTPDU_SIMULATION_TIMESTEP, timeStepMessage); + // additional constructor initialization can go here + } + + /** Initialize channel setup for OpenDis7 and report a test PDU */ + private void initializeDisChannel() + { + if (disChannel == null) + disChannel = new DisChannel(); + else + { + disChannel.printlnTRACE ("*** warning, duplicate invocation of initializeDisChannel() ignored"); + return; + } + pduFactory = disChannel.getPduFactory(); + disChannel.setDescriptor(descriptor); // ExampleSimulationProgram might be a superclass + disChannel.setUpNetworkInterface(); + + disChannel.setVerboseComments (false); // TODO rename library method to disambiguate CommentPDU + // TODO still seems really chatty... add silent mode? + disChannel.setVerboseDisNetworkInterface(false); // Default false + disChannel.getPduRecorder().setVerbose (true); + // TODO confirm whether recorder is explicitly started by programmer (or not) + +// disChannel.sendCommentPdu(VariableRecordType.OTHER, "DisThreadedNetworkInterface.initializeDisChannel() complete"); // hello channel, debug + } + + /** Get ready, get set... initialize simulation entities. Who's who in the zoo? */ + private void initializeSimulationEntities() + { + if (pduFactory == null) + pduFactory = disChannel.getPduFactory(); + entityStatePdu_1 = pduFactory.makeEntityStatePdu(); + entityStatePdu_2 = pduFactory.makeEntityStatePdu(); + firePdu_1a = pduFactory.makeFirePdu(); + firePdu_1b = pduFactory.makeFirePdu(); + munitionDescriptor1 = new MunitionDescriptor(); + + // Your model setup: define participants. who's who in this zoo? + // Assuming you keep track of entity objects... here is some support for for Entity 1. + + // PDU objects are already declared and instances created, so now set their values. + // who is who in our big zoo, sufficient for global participation if we need it + + /***** Initialize each PDU to a known state *****/ + entityStatePdu_1.getEntityID().setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID; + disChannel.addEntity(entityStatePdu_1.getEntityID()); + // TODO someday, use enumerations for sites as part of a SimulationManager object; e.g. is there a unique site triplet for MOVES Institute? + + // Essential that we have a known initial state for DeadReckoningParameters + DeadReckoningParameters drp = entityStatePdu_1.getDeadReckoningParameters(); + + // Set Dead Reckoning Model (DRM), Rotational Velocity in World Coordinates (RVW) + drp.setDeadReckoningAlgorithm(DeadReckoningAlgorithm.DRM_RVW_HIGH_SPEED_OR_MANEUVERING_ENTITY_WITH_EXTRAPOLATION_OF_ORIENTATION); + /***** End Initialize pdu *****/ + + /***** Begin friendly vehicle specific DIS Enumerations *****/ + entityStatePdu_1.setForceId(ForceID.FRIENDLY); + entityStatePdu_1.setEntityType(new ScanEagleA15()); // note import statement above + EntityType type = entityStatePdu_1.getEntityType(); + + // Use ASCII for the character set + entityStatePdu_1.getMarking().setCharacterSet(EntityMarkingCharacterSet.ASCII); + Charset cs = Charset.forName("US-ASCII"); + byte[] charArray = cs.encode(type.toString() + entityStatePdu_1.getEntityID()).array(); + entityStatePdu_1.getMarking().setCharacters(charArray); + + type.setEntityKind(EntityKind.PLATFORM); + type.setDomain(Domain.inst(PlatformDomain.AIR)); + + // Zero until we know more about how we want to define capabilities + entityStatePdu_1.setCapabilities(new AirPlatformCapabilities()); + + // Need to set bits 1-32 for proper initialization + entityStatePdu_1.setEntityAppearance(0); + + // Side number of SubCategory + type.setSpecific(0); + + // Weapons loading? + type.setExtra((short) 0); + /***** End friendly vehicle specific DIS Enumerations *****/ + + entityStatePdu_2.getEntityID().setSiteID(1).setApplicationID(2).setEntityID(4); // made-up example ID; + disChannel.addEntity(entityStatePdu_2.getEntityID()); + entityStatePdu_2.setForceId(ForceID.OPPOSING); + entityStatePdu_2.setEntityType(new _002Triton()); // note import statement above + entityStatePdu_2.setMarking("Entity #2"); + + // TODO how should we customize this munition? what are key parameters for your simulation? + // more is needed here by scenario authors... + munitionDescriptor1.setQuantity(1); + firePdu_1a.setDescriptor(munitionDescriptor1).setRange(1000.0f); + + simulationTimeSeconds = simulationTimeInitial = entityStatePdu_1.getTimestamp(); + } + + /** + * This runSimulationLoops() method is for you, a customizable programmer-modifiable + * code block for defining and running a new simulation of interest. + * + * Welcome! Other parts of this program handle bookkeeping and plumbing tasks so that + * you can focus on your model entities and activities. + * Expandable support includes DIS EntityStatePdu, FirePdu and CommentPdu all available for + * modification and sending in a simulation loop. + * Continuous improvement efforts seek to make this program as easy and straightforward + * as possible for DIS simulationists to use and adapt. + * All of the other methods are setup, teardown and configuration that you may find + * interesting, even helpful, but don't really have to worry about. + */ + @SuppressWarnings("SleepWhileInLoop") // yes we might do that + public void runSimulationLoops () + { + try + { + final int SIMULATION_MAX_LOOP_COUNT = 10; // be deliberate out there! also avoid infinite loops. + int simulationLoopCount = 0; // variable, initialized at 0 + boolean simulationComplete = false; // sentinel variable as termination condition, are we done yet? + + // TODO reset Clock Time for today's date and timestamp to zero, providing consistent outputs for each simulation run + String timeMessage = "Simulation time " + simulationTimeSeconds + " at LocalDateTime " + LocalDateTime.now(); + disChannel.sendCommentPdu(simulationTimeSeconds, DisChannel.COMMENTPDU_TIME, timeMessage); + // TODO replace enumeration with disChannel.COMMENTPDU_TIME + // TODO fix VariableRecordType.TIME_AMP_DATE_VALID + + // =================================================================================================== + // loop the simulation while allowed, programmer can set additional conditions to break out and finish + while (simulationLoopCount < SIMULATION_MAX_LOOP_COUNT) // are we done yet? + { + simulationLoopCount++; // good practice: increment loop counter as first action in that loop + + // ============================================================================================= + // * your own simulation code starts here! ***************************************************** + // ============================================================================================= + + // are there any other variables to modify at the beginning of your loop? + + // are your reading any DIS PDUs from the network? check for them here + + // compute a track, update an ESPDU, whatever it is that your model is doing... + + // Where is my entity? Insert changes in position; this sample only changes X position. + entityStatePdu_1.getEntityLocation().setX(entityStatePdu_1.getEntityLocation().getX() + 1.0); // 1m per timestep + + // decide whether to fire, and then update the firePdu. Hmmm, you might want a target to shoot at! + + // etc. etc. your code goes here for your simulation of interest + + // something happens between my simulation entities, la de da de da... + System.out.println ("... My simulation just did something, no really..."); + System.out.flush(); // make sure this arrives to user even if other threads somehow become deadlocked + + + // make your reports: narrative code for CommentPdu here (set all to empty strings to avoid sending) + narrativeMessage1 = "MV3500 ExampleSimulationProgram"; + narrativeMessage2 = "runSimulation() loop " + simulationLoopCount; + narrativeMessage3 = ""; // intentionally blank for testing + + // your loop termination condition goes here + if (simulationLoopCount > MAX_LOOP_COUNT) // for example + { + simulationComplete = true; + } + // ============================================================================================= + // * your own simulation code is finished here! ************************************************ + // ============================================================================================= + + // staying synchronized with timestep: wait duration for elapsed time in this loop + // Thread.sleep needs a (long) parameter for milliseconds, which are clumsy to use sometimes + Thread.sleep((long)(getSimulationTimeStepDuration() * 1000)); // units of seconds * (1000 msec/sec) = milliseconds + System.out.println ("... [Pausing for " + getSimulationTimeStepDuration() + " seconds]"); + + // OK now send the status PDUs for this loop, and then continue + System.out.println ("... sending PDUs of interest for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent"); + System.out.flush(); + + // TODO set timesteps in PDUs + + sendAllPdusForLoopTimestep(simulationTimeSeconds, + entityStatePdu_1, + firePdu_1a, + DisChannel.COMMENTPDU_APPLICATION_STATUS, + narrativeMessage1, narrativeMessage2, narrativeMessage3); + disChannel.sendSinglePdu(simulationTimeSeconds, entityStatePdu_2); // me too i.e. 2! + + System.out.println ("... [PDUs of interest successfully sent for this loop]"); + System.out.flush(); + + // =============================== + // current loop now finished, check whether to terminate if simulation complete, otherwise continue + if (simulationComplete || (simulationLoopCount > 10000)) // for example; including fail-safe condition is good + { + System.out.println ("... [loop termination condition met, simulationComplete=" + simulationComplete + "]"); // ", final loopCount=" + loopCount + + System.out.flush(); + break; + } + simulationTimeSeconds += getSimulationTimeStepDuration(); // good practice: increment simulationTime as lastst action in that loop + + } // end of simulation loop, continue until done + // ===================================================================================================// ===================================================================================================// ===================================================================================================// =================================================================================================== + + narrativeMessage2 = "runSimulation() completed successfully"; // all done, so tell everyone else on the channel + // TODO better javadoc needs to be autogenerated for VariableRecordType enumerations + disChannel.sendCommentPdu(DisChannel.COMMENTPDU_NARRATIVE, narrativeMessage1, narrativeMessage2, narrativeMessage3); + System.out.println ("... [final=completion CommentPdu successfully sent for simulation]"); + +// disChannel.getPduRecorder(). TODO record XML as well + disChannel.leave(); // embedded SimulationManager is expected to send appropriate PDUs for entity, application shutdown <- Does nothing as of 7/17/24 + } + catch (InterruptedException iex) // handle any exception that your code might choose to provoke! + { + Logger.getLogger(OpenDisHelper.class.getSimpleName()).log(Level.SEVERE, null, iex); + } + } + + /** + * Send EntityState, Fire, Comment PDUs that got updated for this loop, reflecting state of current simulation timestep. + * @param simTimeSeconds simulation time in second, applied to PDU as timestamp + * @param entityStatePdu the ESPDU to send, if any + * @param firePdu the FirePDU to send, if any + * @param commentType enumeration value describing purpose of the narrative comment PDU + * @param comments String array of narrative comments + * @see DisChannel +// * @see DisTime // TODO find renamed version + * @see <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html" target="_blank">Passing Information to a Method or a Constructor</a> Arbitrary Number of Arguments + */ + public void sendAllPdusForLoopTimestep(double simTimeSeconds, + EntityStatePdu entityStatePdu, + FirePdu firePdu, + VariableRecordType commentType, + // vararg... variable-length set of String comments can optionally follow + String... comments) + { + if (entityStatePdu != null) + disChannel.sendSinglePdu(simTimeSeconds, entityStatePdu); + + if (firePdu != null) + disChannel.sendSinglePdu(simTimeSeconds, firePdu); // bang + + disChannel.sendCommentPdu(simTimeSeconds, commentType, comments); // empty comments are filtered + } + + /** + * Initial execution via main() method: handle args array of command-line initialization (CLI) arguments here + * @param args command-line parameters: network address and port + */ + protected void handleArguments (String[] args) + { + // initial execution: handle args array of initialization arguments here + if (args.length == 2) + { + if ((args[0] != null) && !args[0].isEmpty()) + thisProgram.disChannel.setNetworkAddress(args[0]); + if ((args[1] != null) && !args[1].isEmpty()) + thisProgram.disChannel.setNetworkPort(Integer.parseInt(args[1])); + } + else if (args.length != 0) + { + System.err.println("Usage: " + thisProgram.getClass().getSimpleName() + " [address port]"); + System.exit(-1); + } + } + + /** + * Get simple descriptor (such as parent class name) for this network interface, used in trace statements + * @return simple descriptor name + */ + public String getDescriptor() { + return descriptor; + } + + /** + * Set new simple descriptor (such as parent class name) for this network interface, used in trace statements + * @param newDescriptor simple descriptor name for this interface + */ + public void setDescriptor(String newDescriptor) { + if (newDescriptor == null) + newDescriptor = ""; + setName(this.descriptor = newDescriptor); + } + + /** Set an other than default network port + * + * @param port a network port + */ + public void setPort(int port) { + disChannel.setNetworkPort(port); + } + + /** Set an other than default network address + * + * @param address a network address + */ + public void setAddress(String address) { + disChannel.setNetworkAddress(address); + } + + /** + * parameter accessor method + * @return the simulationTimeStepDuration in seconds + */ + public double getSimulationTimeStepDuration() { + return simulationTimeStepDuration; + } + + /** + * parameter accessor method + * @param timeStepDurationSeconds the simulationTimeStepDuration in seconds to set + */ + public void setSimulationTimeStepDuration(double timeStepDurationSeconds) { + this.simulationTimeStepDuration = timeStepDurationSeconds; + } + + /** Locally instantiable copy of program, can be subclassed. */ + protected static OpenDisHelper thisProgram; + + /** + * Main method is first executed when a program instance is loaded. + * @see <a href="https://docs.oracle.com/javase/tutorial/getStarted/application/index.html" target="_blank">Java Tutorials: A Closer Look at the "Hello World!" Application</a> + * @param args command-line parameters: network address and port. + * Command-line arguments are an array of optional String parameters that are passed from execution environment during invocation + */ + public static void main(String[] args) + { + thisProgram = new OpenDisHelper("test constructor"); // create instance of self within static main() method + + thisProgram.disChannel.printlnTRACE("main() started..."); + + thisProgram.handleArguments(args); // process any command-line invocation arguments + + thisProgram.runSimulationLoops(); // ... your simulation execution code goes in there ... + + thisProgram.disChannel.tearDownNetworkInterface(); // make sure no processes are left lingering + + thisProgram.disChannel.printlnTRACE("complete."); // report successful completion + } + +} // end class OpenDisHelper diff --git a/examples/src/UdpExamples/MulticastUdpChatKeyboardLog.txt b/examples/src/UdpExamples/MulticastUdpChatKeyboardLog.txt new file mode 100644 index 0000000000000000000000000000000000000000..c4a07fb833c7cfea7ca64f4495533205b5c88ba6 --- /dev/null +++ b/examples/src/UdpExamples/MulticastUdpChatKeyboardLog.txt @@ -0,0 +1,64 @@ +MulticastUdpChatKeyboardLog.txt + +=============================== +oldlaptop MulticastUdpChatKeyboardSender + +ant -f D:\\x-nps-gitlab\\NetworkedGraphicsMV3500\\examples -Dnb.internal.action.name=run.single -Djavac.includes=UdpExamples/MulticastUdpChatKeyboardSender.java -Drun.class=UdpExamples.MulticastUdpChatKeyboardSender run-single +init: +Deleting: D:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties +deps-jar: +Updating property file: D:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties +Compiling 1 source file to D:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\classes +compile-single: +run-single: +UdpExamples.MulticastUdpChatKeyboardSender started... +Multicast address/port: 239.1.2.15/1718 +[DisThreadedNetworkInterface] using network interface Intel(R) Dual Band Wireless-AC 8260 +type new message here: oldlaptop 1 +Sent packet 1 of 100: "oldlaptop 1" +type new message here: oldlaptop 2 +Sent packet 2 of 100: "oldlaptop 2" +type new message here: quit +Sent packet 3 of 100: "quit" + +=============================== +newlaptop MulticastUdpChatKeyboardSender + +ant -f C:\\x3d-nps-gitlab\\NetworkedGraphicsMV3500\\examples -Dnb.internal.action.name=run.single -Djavac.includes=UdpExamples/MulticastUdpChatKeyboardSender.java -Drun.class=UdpExamples.MulticastUdpChatKeyboardSender run-single +init: +Deleting: C:\x3d-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties +deps-jar: +Updating property file: C:\x3d-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties +Compiling 1 source file to C:\x3d-nps-gitlab\NetworkedGraphicsMV3500\examples\build\classes +compile-single: +run-single: +UdpExamples.MulticastUdpChatKeyboardSender started... +Multicast address/port: 239.1.2.15/1718 +[DisThreadedNetworkInterface] using network interface Intel(R) Wi-Fi 6E AX210 160MHz +type new message here: newlaptop 1 +Sent packet 1 of 100: "newlaptop 1" +type new message here: newlaptop 2 +Sent packet 2 of 100: "newlaptop 2" + +=============================== +oldlaptop MulticastUdpReceiver + +ant -f D:\\x-nps-gitlab\\NetworkedGraphicsMV3500\\examples -Dnb.internal.action.name=run.single -Djavac.includes=UdpExamples/MulticastUdpReceiver.java -Drun.class=UdpExamples.MulticastUdpReceiver run-single +init: +Deleting: D:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties +deps-jar: +Updating property file: D:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties +Compiling 1 source file to D:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\classes +compile-single: +run-single: +UdpExamples.MulticastUdpReceiver started... +[DisThreadedNetworkInterface] using network interface Intel(R) Dual Band Wireless-AC 8260 +Multicast address/port: 239.1.2.15/1718 isBound=true +Multicast packets received log: + 1. "[brutzman 1] oldlaptop 1" + 2. "[brutzman 1] newlaptop 1" + 3. "[brutzman 2] newlaptop 2" + 4. "[brutzman 2] oldlaptop 2" + 5. "[brutzman 3] quit" + +=============================== \ No newline at end of file diff --git a/examples/src/UdpExamples/MulticastUdpChatKeyboardSender.java b/examples/src/UdpExamples/MulticastUdpChatKeyboardSender.java new file mode 100644 index 0000000000000000000000000000000000000000..79ad6716309c91b67c5e3dd64c79d48309b51cd9 --- /dev/null +++ b/examples/src/UdpExamples/MulticastUdpChatKeyboardSender.java @@ -0,0 +1,155 @@ +package UdpExamples; + +import static UdpExamples.MulticastUdpReceiver.BUFFER_LENGTH; +import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface; +import java.io.*; +import java.net.*; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Get keyboard input to send string packets on a UDP multicast group. + * The source looks a lot like MulticastUdpSender. + * TODO: Start this after launching MulticastUdpReceiver. + * Multicast must be enabled for the (wired or wireless) LAN that the system is connected too. + * Note that these paired programs can communicate within a remote LAN (such as a wireless + * home network) even if one or both machines are connected via a + * <a href="https://en.wikipedia.org/wiki/Virtual_private_network" target="_blank">Virtual Private Network (VPN)</a>. + * + * Privacy note: this sender advertises your user name as part of the multicast packet message + * + * @author mcgredo + * @author brutzman@nps.edu + */ +public class MulticastUdpChatKeyboardSender +{ + /** Default constructor */ + public MulticastUdpChatKeyboardSender() + { + // default constructor + } + // reserved range for all IPv4 multicast: 224.0.0.0 through 239.255.255.255 + // https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml + + /** Default multicast group address for send and receive connections. + * @see <a href="https://en.wikipedia.org/wiki/Multicast_address" target="_blank">https://en.wikipedia.org/wiki/Multicast_address</a> */ + public static final String MULTICAST_ADDRESS = "239.1.2.15"; // within reserved multicast address range + /** Default socket port used, matches Wireshark DIS capture default + * @see <a href="https://en.wikipedia.org/wiki/Port_(computer_networking)" target="_blank">https://en.wikipedia.org/wiki/Port_(computer_networking)</a> */ + public static final int DESTINATION_PORT = 1718; + + /** Time to live: how many router-decrement levels can be crossed */ + public static final int TTL = 10; + + /** How many packets to send prior to termination */ + public static final int MAXLOOPSIZE = 100; // or maybe 20000 + + /** How many packets to send prior to termination */ + public static final String LINE_TERMINATOR = "###;"; // do not begin with ; + + /** Receiving this message causes termination + * @see <a href="https://en.wikipedia.org/wiki/Sentinel_value" target="_blank">https://en.wikipedia.org/wiki/Sentinel_value</a> */ + public static final String QUIT_SENTINEL = "QUIT QUIT QUIT!"; + private static NetworkInterface ni; + + /** + * Program invocation, execution starts here. + * TODO: allow setting address/port group and provide help message. + * @param args command-line arguments + * @throws java.io.IOException execution error + */ + @SuppressWarnings("SleepWhileInLoop") + public static void main(String[] args) throws IOException + { + MulticastSocket multicastSocket = null; + InetSocketAddress group = null; + + // Put together a message with binary content. "ByteArrayOutputStream" + // is a java.io utility that lets us put together an array of binary + // data, which we put into the UDP packet. + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DataOutputStream dos = new DataOutputStream(baos); + + try + { + System.out.println("UdpExamples.MulticastUdpChatKeyboardSender started..."); + // https://stackoverflow.com/questions/18747134/getting-cant-assign-requested-address-java-net-socketexception-using-ehcache + System.setProperty("java.net.preferIPv4Stack", "true"); + + // multicast group we are sending to--not a single host + multicastSocket = new MulticastSocket(/*DESTINATION_PORT*/); + multicastSocket.setTimeToLive(TTL); // time to live reduces scope of transmission + InetAddress multicastAddress = InetAddress.getByName(MULTICAST_ADDRESS); + System.out.println("Multicast address/port: " + multicastAddress.getHostAddress() + "/" + DESTINATION_PORT); + + group = new InetSocketAddress(multicastAddress, DESTINATION_PORT); + // Join group useful on receiving side + multicastSocket.joinGroup(group, ni = DisThreadedNetworkInterface.findIpv4Interface()); + // You can join multiple groups here + + byte[] buffer = baos.toByteArray(); + DatagramPacket packet = new DatagramPacket(buffer, buffer.length, group/*, DESTINATION_PORT*/); + + String userName = System.getProperty("user.name"); + String newMessage = new String(); // from user via keyboard + + for (int messageIndex = 1; messageIndex < MAXLOOPSIZE; messageIndex++) + { + String spacer = new String(); // align console outputs + if (messageIndex < 10) + spacer = " "; + + // Put together an updated packet to send + if (messageIndex < MAXLOOPSIZE) + { + System.out.print ("type new message here: "); + newMessage = System.console().readLine(); // this line blocks, awaiting keyboard input from user +// System.out.println ("[trace] console return: " + newMessage); + + // avoid overrunning receive buffer + int maxStringLength = BUFFER_LENGTH - LINE_TERMINATOR.length() - userName.length() - 5; + if (newMessage.length() > maxStringLength) + newMessage = newMessage.substring(0, maxStringLength); + + // Put together an updated packet to send + dos.writeChars("[" + userName + " " + spacer + messageIndex + "] "); + dos.writeChars(newMessage + LINE_TERMINATOR); // string chars for readability, include ; semicolon as termination sentinel + } + else dos.writeChars(QUIT_SENTINEL + LINE_TERMINATOR); // note string must include ; semicolon as termination sentinel + + buffer = baos.toByteArray(); + packet.setData(buffer); + multicastSocket.send(packet); + System.out.print ("Sent packet " + spacer + (messageIndex) + " of " + MAXLOOPSIZE + ": "); + System.out.println("\"" + newMessage + "\""); + baos.reset(); + + // How fast does this go? Does UDP try to slow it down, or does + // this cause network problems? (hint: yes for an unlimited send + // rate, unlike TCP). How do you know on the receiving side + // that you haven't received a duplicate UDP packet, out of + // order packet, or dropped packet? Necessary considerations. + Thread.sleep(1000); // only send one per second + } + System.out.println("MulticastSender complete."); + } + catch(IOException | InterruptedException e) + { + System.err.println("Problem with MulticastSender, see exception trace:"); + System.err.println(e); + } finally { + + if (multicastSocket != null && !multicastSocket.isClosed()) { + try { + multicastSocket.leaveGroup(group, ni); + } catch (IOException ex) { + Logger.getLogger(MulticastUdpChatKeyboardSender.class.getName()).log(Level.SEVERE, null, ex); + } + multicastSocket.close(); + } + + dos.close(); + } + } + +} diff --git a/examples/src/UdpExamples/MulticastUdpReceiver.java b/examples/src/UdpExamples/MulticastUdpReceiver.java index e7d5220158b9ae03570998d5729f7ecaa6853348..83b5c415e9c0f5ac468984ab26d3fc1fbbf0b81a 100644 --- a/examples/src/UdpExamples/MulticastUdpReceiver.java +++ b/examples/src/UdpExamples/MulticastUdpReceiver.java @@ -1,5 +1,6 @@ package UdpExamples; +import static UdpExamples.MulticastUdpChatKeyboardSender.LINE_TERMINATOR; import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface; import java.io.*; import java.net.*; @@ -8,7 +9,12 @@ import java.util.logging.Level; import java.util.logging.Logger; /** - * Looks a lot like UdpReceiver. Start this before launching MulticastSender. + * Send preformatted test packets on a UDP multicast group. + * The source looks a lot like UnicastUdpReceiver. Start this before launching MulticastUdpSender. + * Multicast must be enabled for the (wired or wireless) LAN that the system is connected too. + * Note that these paired programs can communicate within a remote LAN (such as a wireless + * home network) even if one or both machines are connected via a + * <a href="https://en.wikipedia.org/wiki/Virtual_private_network" target="_blank">Virtual Private Network (VPN)</a>. * * @author mcgredo * @author brutzman@nps.edu @@ -33,6 +39,8 @@ public class MulticastUdpReceiver private static final boolean INFINITE_READ_LOOP = true; private static NetworkInterface ni; + + public static final int BUFFER_LENGTH = 1500; /** * Program invocation, execution starts here @@ -42,7 +50,7 @@ public class MulticastUdpReceiver { MulticastSocket multicastSocket = null; InetSocketAddress group = null; - ByteBuffer buffer = ByteBuffer.allocate(1500); + ByteBuffer buffer = ByteBuffer.allocate(BUFFER_LENGTH); DatagramPacket packet = new DatagramPacket(buffer.array(), buffer.capacity()); try { @@ -62,49 +70,75 @@ public class MulticastUdpReceiver group = new InetSocketAddress(multicastAddress, DESTINATION_PORT); // Join group useful on receiving side - multicastSocket.joinGroup(group, ni = DisThreadedNetworkInterface.findIpv4Interface()); + multicastSocket.joinGroup(group, ni = DisThreadedNetworkInterface.findIpv4Interface()); // utility function // You can join multiple groups here - System.out.println("Multicast address/port: " + multicastAddress.getHostAddress() + "/" + DESTINATION_PORT); + System.out.println("Multicast address/port: " + multicastAddress.getHostAddress() + "/" + DESTINATION_PORT + + " isBound=" + multicastSocket.isBound()); + // unnecessary, no server involved: + "isConnected=" + multicastSocket.isConnected() System.out.println("Multicast packets received log:"); - int index, count = 0; // initialize - float firstFloat, secondFloat; + int messageCount = 0; // initialize StringBuilder firstCharacters = new StringBuilder(); char nextChar; - while (true) { // true is always true, so this is an infinite loop that continues until interrupted - multicastSocket.receive(packet); - count++; + while (true) // true is always true, so this is an infinite loop that continues until interrupted + { + // initializations for this loop + int messageIndex = 0; + float firstFloat = 0.0f; + float secondFloat = 0.0f; + + multicastSocket.receive(packet); // this method call will block until a packet is received + messageCount++; - nextChar = ' '; + nextChar = ' '; // reinitialize while (nextChar != ';') // read and build string until terminator ; found { nextChar = buffer.getChar(); firstCharacters.append(nextChar); } - if (firstCharacters.toString().contains(MulticastUdpSender.QUIT_SENTINEL)) { + if (firstCharacters.toString().contains(MulticastUdpSender.QUIT_SENTINEL)) + { System.out.println("Received sentinel \"" + MulticastUdpSender.QUIT_SENTINEL + "\""); if (!INFINITE_READ_LOOP) { break; // exit out of reading loop } } - index = buffer.getInt(); - firstFloat = buffer.getFloat(); - secondFloat = buffer.getFloat(); + boolean foundNumbers = false; + String line = firstCharacters.toString(); + if (line.contains(LINE_TERMINATOR)) + { + foundNumbers = false; + firstCharacters.setLength(line.length() - LINE_TERMINATOR.length()); // clip EOL sentinel + } + else if (buffer.hasRemaining()) // likely always true since size is 1500 + { + messageIndex = buffer.getInt(); + firstFloat = buffer.getFloat(); + secondFloat = buffer.getFloat(); + // simplistic tests for numbers read from buffer + if ((messageIndex == 0) && (firstFloat == 0.0f) && (secondFloat == 0.0f)) + foundNumbers = false; + else if ((messageIndex >= 0) && (messageIndex <= 10000)) + foundNumbers = true; + } + else System.out.print("[trace] no numbers encountered in buffer"); buffer.clear(); - if (count < 10) { - System.out.print(" "); // prettier output formatting + if (messageCount < 10) { + System.out.print(" "); // prettier output formatting for first nine lines } - System.out.print(count + ". \"" + firstCharacters + "\" "); // wrap string in quote marks - System.out.println("index=" + index + ", firstFloat=" + firstFloat + " secondFloat=" + secondFloat); - - System.out.println("MulticastReceiver loop complete."); - firstCharacters.setLength(0); + System.out.println(messageCount + ". \"" + firstCharacters + "\" "); // wrap string in quote marks + if (foundNumbers) + { + System.out.println(" messageIndex=" + messageIndex + ", firstFloat=" + firstFloat + " secondFloat=" + secondFloat); + System.out.println(" MulticastUdpReceiver message receipt complete."); + } + firstCharacters.setLength(0); // reset } } catch (IOException e) { - System.err.println("Problem with MulticastReceiver, see exception trace:"); + System.err.println("Problem with MulticastUdpReceiver, see exception trace:"); System.err.println(e); } finally // clean up after exit condition { @@ -117,7 +151,7 @@ public class MulticastUdpReceiver multicastSocket.close(); } // socket/database/completion cleanup code can go here, if needed. - System.out.println("MulticastReceiver finally block, complete."); + System.out.println("MulticastUdpReceiver finally block, complete."); } } } diff --git a/examples/src/UdpExamples/MulticastUdpSender.java b/examples/src/UdpExamples/MulticastUdpSender.java index 68788b7f83da4a6edbf7c8d358669ebd7de0963f..9d6e95c77b4540e2eca94864d707669155416297 100644 --- a/examples/src/UdpExamples/MulticastUdpSender.java +++ b/examples/src/UdpExamples/MulticastUdpSender.java @@ -7,7 +7,12 @@ import java.util.logging.Level; import java.util.logging.Logger; /** - * Looks a lot like UdpSender. Start this after launching MulticastReceiver. + * Send preformatted test packets on a UDP multicast group. + * The source looks a lot like UnicastUdpSender. Start this after launching MulticastUdpReceiver. + * Multicast must be enabled for the (wired or wireless) LAN that the system is connected too. + * Note that these paired programs can communicate within a remote LAN (such as a wireless + * home network) even if one or both machines are connected via a + * <a href="https://en.wikipedia.org/wiki/Virtual_private_network" target="_blank">Virtual Private Network (VPN)</a>. * * Privacy note: this sender advertises your user name as part of the multicast packet message * @@ -77,7 +82,7 @@ public class MulticastUdpSender group = new InetSocketAddress(multicastAddress, DESTINATION_PORT); // Join group useful on receiving side - multicastSocket.joinGroup(group, ni = DisThreadedNetworkInterface.findIpv4Interface()); + multicastSocket.joinGroup(group, ni = DisThreadedNetworkInterface.findIpv4Interface()); // utility function // You can join multiple groups here byte[] buffer = baos.toByteArray(); @@ -91,6 +96,7 @@ public class MulticastUdpSender // Put together an updated packet to send dos.writeChars("From " + System.getProperty("user.name") + ": "); dos.writeChars("MulticastSender packet " + Integer.toString(index) + ";"); // string chars for readability + // semicolon as message terminator prior to numbers dos.writeInt (index); // arbitrary data, needs Java or byte-alignment to read dos.writeFloat(17.0f); // arbitrary data, needs Java or byte-alignment to read dos.writeFloat(23.0f); // arbitrary data, needs Java or byte-alignment to read diff --git a/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/ArrivalProcessOpenDis7Assembly.xml b/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/ArrivalProcessOpenDis7Assembly.xml new file mode 100644 index 0000000000000000000000000000000000000000..87787fc2afa70f4122f89029fae5350ab3793b37 --- /dev/null +++ b/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/ArrivalProcessOpenDis7Assembly.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimkitAssembly name="ArrivalProcessOpenDis7Assembly" version="1.0" package="dis7" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/assembly.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SimEntity name="aPOpenDis7" type="dis7.ArrivalProcessOpenDis7" description=""> + <TerminalParameter name="address" value="" type="java.lang.String"/> + <TerminalParameter name="port" value="-1" type="int"/> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Exponential" type="String"/> + <TerminalParameter name="" value="1.7" type="Object..."/> + </FactoryParameter> + <Coordinate x="220.0" y="210.0"/> + </SimEntity> + <PropertyChangeListener name="numArrivalsStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true" description=""> + <TerminalParameter name="p[0] : " value="N" type="java.lang.String"/> + <Coordinate x="220.0" y="330.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numEntityCreationsStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true" description=""> + <TerminalParameter name="p[0] : " value="C" type="java.lang.String"/> + <Coordinate x="220.0" y="80.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numEntityRemovalsStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true" description=""> + <TerminalParameter name="p[0] : " value="R" type="java.lang.String"/> + <Coordinate x="380.0" y="210.0"/> + </PropertyChangeListener> + <PropertyChangeListenerConnection property="N" listener="numArrivalsStat" source="aPOpenDis7" description=""/> + <PropertyChangeListenerConnection property="C" listener="numEntityCreationsStat" source="aPOpenDis7" description=""/> + <PropertyChangeListenerConnection property="R" listener="numEntityRemovalsStat" source="aPOpenDis7" description=""/> + <Schedule stopTime="100.0" verbose="false" saveReplicationData="false"/> +</SimkitAssembly> diff --git a/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/SimpleServerDis7Assembly.xml b/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/SimpleServerDis7Assembly.xml new file mode 100755 index 0000000000000000000000000000000000000000..11d6ab585dab9323bd35b9aad841dd336e49d286 --- /dev/null +++ b/examples/src/ViskitOpenDis7Examples/Assemblies/dis7/SimpleServerDis7Assembly.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimkitAssembly name="SimpleServerDis7Assembly" version="1.0" package="dis7" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/assembly.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SimEntity name="arrivalProcessOpenDis7" type="SimkitOpenDis7Examples.ArrivalProcessOpenDis7" description=""> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Uniform" type="String"/> + <TerminalParameter name="" value="0.9, 2.2" type="Object..."/> + </FactoryParameter> + <Coordinate x="90.0" y="200.0"/> + </SimEntity> + <SimEntity name="simpleServer" type="SimkitOpenDis7Examples.SimpleServer" description=""> + <TerminalParameter name="p[0] : " value="1" type="int"/> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Gamma" type="String"/> + <TerminalParameter name="" value="1.7, 1.8" type="Object..."/> + </FactoryParameter> + <Coordinate x="310.0" y="200.0"/> + </SimEntity> + <PropertyChangeListener name="numInQueueStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="true" countStatistics="false" description=""> + <TerminalParameter name="p[0] : " value="numberInQueue" type="java.lang.String"/> + <Coordinate x="310.0" y="80.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numAvailServersStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="true" countStatistics="false" description=""> + <TerminalParameter name="p[0] : " value="numberAvailableServers" type="java.lang.String"/> + <Coordinate x="510.0" y="200.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numArrivalsStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true" description=""> + <TerminalParameter name="p[0] : " value="numberArrivals" type="java.lang.String"/> + <Coordinate x="90.0" y="80.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numServedStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true" description=""> + <TerminalParameter name="p[0] : " value="numberServed" type="java.lang.String"/> + <Coordinate x="310.0" y="350.0"/> + </PropertyChangeListener> + <SimEventListenerConnection listener="simpleServer" source="arrivalProcessOpenDis7"/> + <PropertyChangeListenerConnection property="numberInQueue" listener="numInQueueStat" source="simpleServer" description=""/> + <PropertyChangeListenerConnection property="numberAvailableServers" listener="numAvailServersStat" source="simpleServer" description=""/> + <PropertyChangeListenerConnection property="numberArrivals" listener="numArrivalsStat" source="arrivalProcessOpenDis7" description=""/> + <PropertyChangeListenerConnection property="numberServed" listener="numServedStat" source="simpleServer" description=""/> + <Schedule stopTime="100000.0" verbose="false" saveReplicationData="false"/> +</SimkitAssembly> diff --git a/examples/src/ViskitOpenDis7Examples/EventGraphs/dis7/ArrivalProcessOpenDis7.xml b/examples/src/ViskitOpenDis7Examples/EventGraphs/dis7/ArrivalProcessOpenDis7.xml new file mode 100644 index 0000000000000000000000000000000000000000..f1dd2c6371c7520450a510b6427c2eeb0fb4754d --- /dev/null +++ b/examples/src/ViskitOpenDis7Examples/EventGraphs/dis7/ArrivalProcessOpenDis7.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="ArrivalProcessOpenDis7" package="dis7" version="1.0" author="terry" extend="SimkitOpenDis7Examples.run.OpenDisHelper" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter name="address" type="java.lang.String"> + <Comment>An other than default network address</Comment> + </Parameter> + <Parameter name="port" type="int"> + <Comment>An other than default network port</Comment> + </Parameter> + <Parameter name="tA" type="simkit.random.RandomVariate"> + <Comment>Inter arrival time</Comment> + </Parameter> + <StateVariable name="N" type="int"> + <Comment>Number of arrivals</Comment> + </StateVariable> + <StateVariable name="C" type="int"> + <Comment>Number of entity creations</Comment> + </StateVariable> + <StateVariable name="R" type="int"> + <Comment>Number of entity removals</Comment> + </StateVariable> + <Event name="Run" description="This event is fired first to facilitate initialization of all simulation state variables"> + <Comment>Initialize all state variables</Comment> + <StateTransition state="N"> + <Assignment value="0"/> + </StateTransition> + <StateTransition state="C"> + <Assignment value="1"/> + </StateTransition> + <StateTransition state="R"> + <Assignment value="0"/> + </StateTransition> + <Schedule delay="tA.generate()" event="Arrival" priority="DEFAULT"/> + <Code></Code> + <Coordinate x="50.0" y="70.0"/> + </Event> + <Event name="Arrival"> + <Comment>Tallys the number of arrivals and schedules future arrival events with time tA</Comment> + <StateTransition state="N"> + <Assignment value="N + 1"/> + </StateTransition> + <Schedule delay="tA.generate()" event="Arrival" priority="DEFAULT"/> + <Code>int everyTen = 10; +int oldC = C; +int oldR = R; + +if ((N % everyTen) == 0) { + disChannel.removeEntity(entityStatePdu_1.getEntityID()); + firePropertyChange("R", oldR, R+1); +} else { + disChannel.addEntity(entityStatePdu_1.getEntityID()); + firePropertyChange("C", oldC, C+1); +}</Code> + <Coordinate x="260.0" y="70.0"/> + </Event> + <Code></Code> +</SimEntity> diff --git a/examples/src/ViskitOpenDis7Examples/lib/Networked_Graphics_MV3500_examples.jar b/examples/src/ViskitOpenDis7Examples/lib/Networked_Graphics_MV3500_examples.jar new file mode 100644 index 0000000000000000000000000000000000000000..35ebf4ea7009c85ef6c28842ac4d75c08979a120 Binary files /dev/null and b/examples/src/ViskitOpenDis7Examples/lib/Networked_Graphics_MV3500_examples.jar differ diff --git a/examples/src/ViskitOpenDis7Examples/viskitProject.xml b/examples/src/ViskitOpenDis7Examples/viskitProject.xml new file mode 100644 index 0000000000000000000000000000000000000000..1d20dbac80274c45b7e83d70c0852ed95ea99f27 --- /dev/null +++ b/examples/src/ViskitOpenDis7Examples/viskitProject.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViskitProject name="ViskitOpenDis7Examples"> + <AnalystReports name="AnalystReports" /> + <AssembliesDirectory name="Assemblies" /> + <EventGraphsDirectory name="EventGraphs" /> + <BuildDirectory name="build"> + <ClassesDirectory name="classes" /> + <SourceDirectory name="src" /> + </BuildDirectory> + <DistDirectory name="dist" /> + <LibDirectory name="lib" /> + <Cached></Cached> + <extraClassPaths> + </extraClassPaths> +</ViskitProject> + diff --git a/examples/src/overview.html b/examples/src/overview.html index 6934f6486fdc55ff3e6da9d143d70624290f00d9..3e6b58ffaf0088e568d179b0164a8c037772d289 100644 --- a/examples/src/overview.html +++ b/examples/src/overview.html @@ -5,7 +5,7 @@ <h1> Course Resources </h1> <p> <!-- Note that javadoc throws an incorrect error regarding title attribute, but resulting HTML works as expected --> - <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/README.md" target="_blank" title="Open-Dis Surfer Dude, Thanks Don McGregor!"><img src="OpenDisSurferDude.png" alt="Open-Dis Surfer Dude, Thanks Don McGregor!" style="float:right"/></a> + <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/README.md" target="_blank"><img src="OpenDisSurferDude.png" alt="Open-Dis Surfer Dude, Thanks Don McGregor!" style="float:right"/></a> <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments" target="_blank">Assignments</a>, <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/examples" target="_blank">examples</a>, and <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/presentations" target="_blank">presentations</a> diff --git a/presentations/08_DIS_DistributedInteractiveSimulationProtocol.pptx b/presentations/08a_DIS_DistributedInteractiveSimulationProtocol.pptx similarity index 100% rename from presentations/08_DIS_DistributedInteractiveSimulationProtocol.pptx rename to presentations/08a_DIS_DistributedInteractiveSimulationProtocol.pptx diff --git a/presentations/08b_DIS_Tutorial_redirect.html b/presentations/08b_DIS_Tutorial_redirect.html new file mode 100644 index 0000000000000000000000000000000000000000..6cbe0cd314c842c2c631f1901069d0cb9830e18d --- /dev/null +++ b/presentations/08b_DIS_Tutorial_redirect.html @@ -0,0 +1,16 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <!-- If you are seeing this source HTML, please go to the link below! --> + <head> + <meta http-equiv="Content-Style-Type" content="text/html"> + <title>08b_DIS_DistributedInteractiveSimulationTutorial redirect</title> + <meta http-equiv="refresh" content="0; url=https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/conferences/IITSEC2021/README.md"> + </head> + <body> + <p> + Go to the + <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/conferences/IITSEC2021/README.md">Distributed Interactive Simulation (DIS) 101 Tutorial: The Basics</a> + page... + </p> + </body> +</html> \ No newline at end of file diff --git a/presentations/08b_DIS_Tutorial_redirect.md b/presentations/08b_DIS_Tutorial_redirect.md new file mode 100644 index 0000000000000000000000000000000000000000..b574e5ef49eb9ac603319c5af019bde2644169cc --- /dev/null +++ b/presentations/08b_DIS_Tutorial_redirect.md @@ -0,0 +1,2 @@ +Please go to +[Distributed Interactive Simulation (DIS) 101 Tutorial: The Basics](https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/conferences/IITSEC2021/README.md) diff --git a/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ArrayTesterAssembly.xml b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ArrayTesterAssembly.xml new file mode 100644 index 0000000000000000000000000000000000000000..707a13a58727fff5f82f1bbb98725b9b015f8acf --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ArrayTesterAssembly.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimkitAssembly name="ArrayTestAssembly" version="1.0" package="examples" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/assembly.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SimEntity name="ArrayTester_3" type="examples.ArrayTester" description=""> + <MultiParameter type="int[]"> + <TerminalParameter name="" value="17" type="int"/> + <TerminalParameter name="" value="52" type="int"/> + </MultiParameter> + <Coordinate x="170.0" y="60.0"/> + </SimEntity> + <PropertyChangeListener name="SimplePropertyDumper_4" type="simkit.util.SimplePropertyDumper" meanStatistics="false" countStatistics="true" description=""> + <Coordinate x="170.0" y="200.0"/> + </PropertyChangeListener> + <PropertyChangeListenerConnection listener="SimplePropertyDumper_4" source="ArrayTester_3"/> + <Output entity="ArrayTester_3"/> + <Schedule stopTime="100." verbose="false" saveReplicationData="false"/> + <Experiment replicationsPerDesignPoint="1" totalSamples="1" timeout="5000"/> +</SimkitAssembly> diff --git a/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/InventoryModelAssembly.xml b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/InventoryModelAssembly.xml new file mode 100644 index 0000000000000000000000000000000000000000..254b649cb5f5936ef1787c71590616146bc3b71c --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/InventoryModelAssembly.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimkitAssembly name="InventoryModelAssembly" version="1.0" package="examples" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/assembly.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SimEntity name="arrivalProcess_0" type="examples.ArrivalProcess" description=""> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Uniform" type="String"/> + <TerminalParameter name="" value="0.9, 2.2" type="Object..."/> + </FactoryParameter> + <Coordinate x="100.0" y="200.0"/> + </SimEntity> + <SimEntity name="inventoryModel_1" type="examples.InventoryModel" description=""> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="DiscreteInteger" type="String"/> + <TerminalParameter name="" value="new int[] {1, 2, 3, 4}, new double[] {40, 30, 20, 10}" type="Object..."/> + </FactoryParameter> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Gamma" type="String"/> + <TerminalParameter name="" value="1.7, 1.8" type="Object..."/> + </FactoryParameter> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Constant" type="String"/> + <TerminalParameter name="" value="1.8" type="java.lang.Object"/> + </FactoryParameter> + <TerminalParameter name="I0" value="15" type="int"/> + <TerminalParameter name="bigS" value="10" type="int"/> + <TerminalParameter name="littleS" value="5" type="int"/> + <Coordinate x="410.0" y="200.0"/> + </SimEntity> + <PropertyChangeListener name="numArrivalsStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true" description=""> + <TerminalParameter name="p[0] : " value="numberArrivals" type="java.lang.String"/> + <Coordinate x="100.0" y="310.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="demandStat" type="simkit.stat.SimpleStatsTally" mode="replicationStat" meanStatistics="true" countStatistics="false" description=""> + <TerminalParameter name="p[0] : " value="demand" type="java.lang.String"/> + <Coordinate x="410.0" y="90.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="inventoryOnHandStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="true" countStatistics="false" description=""> + <TerminalParameter name="p[0] : " value="I" type="java.lang.String"/> + <Coordinate x="290.0" y="90.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="inventoryOnBackOrderStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="true" countStatistics="false" description=""> + <TerminalParameter name="p[0] : " value="B" type="java.lang.String"/> + <Coordinate x="540.0" y="90.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="inventoryOnOrderStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="true" countStatistics="false" description=""> + <TerminalParameter name="p[0] : " value="T" type="java.lang.String"/> + <Coordinate x="610.0" y="200.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="immedServedCustStat" type="simkit.stat.SimpleStatsTally" mode="replicationStat" meanStatistics="false" countStatistics="true" description=""> + <TerminalParameter name="p[0] : " value="immediatelyServedCustomers" type="java.lang.String"/> + <Coordinate x="410.0" y="330.0"/> + </PropertyChangeListener> + <SimEventListenerConnection listener="inventoryModel_1" source="arrivalProcess_0"/> + <PropertyChangeListenerConnection property="numberArrivals" listener="numArrivalsStat" source="arrivalProcess_0" description=""/> + <PropertyChangeListenerConnection property="demand" listener="demandStat" source="inventoryModel_1" description=""/> + <PropertyChangeListenerConnection property="I" listener="inventoryOnHandStat" source="inventoryModel_1" description=""/> + <PropertyChangeListenerConnection property="B" listener="inventoryOnBackOrderStat" source="inventoryModel_1" description=""/> + <PropertyChangeListenerConnection property="T" listener="inventoryOnOrderStat" source="inventoryModel_1" description=""/> + <PropertyChangeListenerConnection property="immediatelyServedCustomers" listener="immedServedCustStat" source="inventoryModel_1" description=""/> + <Schedule stopTime="100000.0" verbose="false" saveReplicationData="false"/> +</SimkitAssembly> diff --git a/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerAssembly3.xml b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerAssembly3.xml new file mode 100644 index 0000000000000000000000000000000000000000..680a77807ab5ccf4c5877bf593b119a68ed3e9e0 --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerAssembly3.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimkitAssembly name="ServerAssembly3" version="1.0" package="examples" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/assembly.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SimEntity name="arrival" type="examples.ArrivalProcess" description=""> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Exponential" type="java.lang.String"/> + <TerminalParameter name="" value="1.7" type="double"/> + </FactoryParameter> + <Coordinate x="90.0" y="90.0"/> + </SimEntity> + <SimEntity name="server" type="examples.SimpleServer" description=""> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Gamma" type="java.lang.String"/> + <TerminalParameter name="" value="2.1" type="double"/> + <TerminalParameter name="" value="1.6" type="double"/> + </FactoryParameter> + <TerminalParameter name="totalNumberServers" value="2" type="int"/> + <Coordinate x="280.0" y="90.0"/> + </SimEntity> + <PropertyChangeListener name="numInQueueStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true"> + <TerminalParameter name="p[0] : " value="numberInQueue" type="java.lang.String"/> + <Coordinate x="210.0" y="230.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numAvailServersStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true"> + <TerminalParameter name="p[0] : " value="numberAvailableServers" type="java.lang.String"/> + <Coordinate x="350.0" y="230.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="simplePropertyDumper" type="simkit.util.SimplePropertyDumper" meanStatistics="false" countStatistics="true"> + <Coordinate x="280.0" y="290.0"/> + </PropertyChangeListener> + <PropertyChangeListenerConnection property="numberInQueue" listener="numInQueueStat" source="server" description=""/> + <PropertyChangeListenerConnection property="numberAvailableServers" listener="numAvailServersStat" source="server" description=""/> + <PropertyChangeListenerConnection listener="simplePropertyDumper" source="server"/> + <Adapter name="adptr_3" eventHeard="Arrival" eventSent="Arrival" from="arrival" to="server"/> + <Output entity="arrival"/> + <Output entity="server"/> + <Schedule stopTime="1000.0" verbose="false" saveReplicationData="false"/> + <Experiment replicationsPerDesignPoint="2" totalSamples="5" timeout="5000"/> +</SimkitAssembly> diff --git a/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerWithRenegesAssembly.xml b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerWithRenegesAssembly.xml new file mode 100644 index 0000000000000000000000000000000000000000..5757a51dc1c6bf3b7b1c1b19aa9631f14252303f --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/ServerWithRenegesAssembly.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimkitAssembly name="ServerWithRenegesAssembly" version="1.0" package="examples" description="TODO add description" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/assembly.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SimEntity name="arrivalProcess" type="examples.ArrivalProcess"> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Exponential" type="java.lang.String"/> + <TerminalParameter name="" value="1.5" type="double"/> + </FactoryParameter> + <Coordinate x="40.0" y="140.0"/> + </SimEntity> + <SimEntity name="creator" type="examples.Creator"> + <Coordinate x="190.0" y="140.0"/> + </SimEntity> + <SimEntity name="serverWithReneges" type="examples.ServerWithReneges"> + <TerminalParameter name="numberServers" value="2" type="int"/> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Gamma" type="java.lang.String"/> + <TerminalParameter name="" value="2.5" type="double"/> + <TerminalParameter name="" value="1.2" type="double"/> + </FactoryParameter> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Uniform" type="java.lang.String"/> + <TerminalParameter name="" value="4" type="int"/> + <TerminalParameter name="" value="6" type="int"/> + </FactoryParameter> + <Coordinate x="350.0" y="140.0"/> + </SimEntity> + <PropertyChangeListener name="numberInQueueStat" type="simkit.stat.CollectionSizeTimeVaryingStats" mode="replicationStat" meanStatistics="false" countStatistics="true"> + <TerminalParameter name="p[0] : " value="queue" type="java.lang.String"/> + <Coordinate x="560.0" y="60.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numberAvailableServersStat" type="simkit.stat.SimpleStatsTally" mode="replicationStat" meanStatistics="false" countStatistics="true"> + <TerminalParameter name="p[0] : " value="numberAvailableServers" type="java.lang.String"/> + <Coordinate x="350.0" y="290.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numberServedStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true"> + <TerminalParameter name="p[0] : " value="numberServed" type="java.lang.String"/> + <Coordinate x="350.0" y="20.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numberRenegesStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true"> + <TerminalParameter name="p[0] : " value="numberReneges" type="java.lang.String"/> + <Coordinate x="560.0" y="140.0"/> + </PropertyChangeListener> + <PropertyChangeListener name="numberArrivalsStat" type="simkit.stat.SimpleStatsTimeVarying" mode="replicationStat" meanStatistics="false" countStatistics="true"> + <TerminalParameter name="p[0] : " value="numberArrivals" type="java.lang.String"/> + <Coordinate x="40.0" y="260.0"/> + </PropertyChangeListener> + <SimEventListenerConnection listener="creator" source="arrivalProcess"/> + <PropertyChangeListenerConnection property="queue" listener="numberInQueueStat" source="serverWithReneges"/> + <PropertyChangeListenerConnection property="numberAvailableServers" listener="numberAvailableServersStat" source="serverWithReneges"/> + <PropertyChangeListenerConnection property="numberServed" listener="numberServedStat" source="serverWithReneges"/> + <PropertyChangeListenerConnection property="numberReneges" listener="numberRenegesStat" source="serverWithReneges"/> + <PropertyChangeListenerConnection property="numberArrivals" listener="numberArrivalsStat" source="arrivalProcess"/> + <Adapter name="adptr_3" eventHeard="CustomerArrival" eventSent="Arrival" from="creator" to="serverWithReneges"/> + <Output entity="creator"/> + <Output entity="arrivalProcess"/> + <Output entity="serverWithReneges"/> + <Schedule stopTime="100.0" verbose="false" saveReplicationData="false"/> + <Experiment replicationsPerDesignPoint="1" totalSamples="1" timeout="5000"/> +</SimkitAssembly> diff --git a/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/TestServerGenericAssembly.xml b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/TestServerGenericAssembly.xml new file mode 100644 index 0000000000000000000000000000000000000000..2dab889dd56ba36113250c3b7aa79c37a661822e --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/Assemblies/examples/TestServerGenericAssembly.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimkitAssembly name="TestServerGenericAssembly" version="$Id: TestServerGenericAssembly.xml 1590 2007-10-07 05:41:19Z tdnorbra $" package="examples" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/assembly.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <SimEntity name="ServerGeneric_0" type="examples.ServerGeneric" description=""> + <TerminalParameter name="totalNumberServers" value="1" type="int"/> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Constant" type="java.lang.String"/> + <TerminalParameter name="" value="1.1" type="double"/> + </FactoryParameter> + <Coordinate x="390.0" y="200.0"/> + </SimEntity> + <SimEntity name="ArrivalProcess_1" type="examples.ArrivalProcess" description=""> + <FactoryParameter factory="simkit.random.RandomVariateFactory" type="simkit.random.RandomVariate"> + <TerminalParameter name="" value="Exponential" type="java.lang.String"/> + <TerminalParameter name="" value="1.2" type="double"/> + </FactoryParameter> + <Coordinate x="140.0" y="200.0"/> + </SimEntity> + <SimEntity name="EntityCreator_2" type="examples.EntityCreator" description=""> + <Coordinate x="260.0" y="200.0"/> + </SimEntity> + <SimEventListenerConnection listener="EntityCreator_2" source="ArrivalProcess_1"/> + <Adapter name="adptr_3" eventHeard="EntityArrival" eventSent="Arrival" from="EntityCreator_2" to="ServerGeneric_0" description=""/> + <Schedule stopTime="100." verbose="false" saveReplicationData="false"/> + <Experiment replicationsPerDesignPoint="1" totalSamples="1" timeout="5000"/> +</SimkitAssembly> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrayTester.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrayTester.xml new file mode 100644 index 0000000000000000000000000000000000000000..3ca1313d465bf411ace53c18d3106941c1d36e77 --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrayTester.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="ArrayTester" package="examples" version="1.0" author="Terry D. Norbraten" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Comment>Test Viskit's capability to create primative type arrays</Comment> + <Parameter name="param_0" type="int[]"> + <Comment></Comment> + </Parameter> + <StateVariable name="state_0" type="int[param_0.length]"> + <Comment></Comment> + </StateVariable> + <Event name="Run"> + <Schedule delay="0.0" event="Init" condition="true" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="0"/> + </Schedule> + <Code></Code> + <Coordinate x="30.0" y="30.0"/> + </Event> + <Event name="Init"> + <Comment></Comment> + <Argument name="i" type="int"/> + <StateTransition state="state_0" index="i"> + <Assignment value="param_0[i]"/> + </StateTransition> + <Schedule delay="0.0" event="Init" condition="i < (param_0.length - 1)" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="i + 1"/> + </Schedule> + <Code></Code> + <Coordinate x="180.0" y="30.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrivalProcess.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrivalProcess.xml new file mode 100755 index 0000000000000000000000000000000000000000..27e8746bd636057dc97bc03657b525685c1c2690 --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ArrivalProcess.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="ArrivalProcess" package="examples" version="0.1" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter name="interarrivalTime" type="simkit.random.RandomVariate"/> + <StateVariable name="numberArrivals" type="int"/> + <Event name="Run"> + <StateTransition state="numberArrivals"> + <Assignment value="0"/> + </StateTransition> + <Schedule delay="interarrivalTime.generate()" event="Arrival" priority="DEFAULT"/> + <Coordinate x="50.0" y="70.0"/> + </Event> + <Event name="Arrival"> + <StateTransition state="numberArrivals"> + <Assignment value="numberArrivals + 1"/> + </StateTransition> + <Schedule delay="interarrivalTime.generate()" event="Arrival" priority="DEFAULT"/> + <Coordinate x="260.0" y="70.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/Creator.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/Creator.xml new file mode 100644 index 0000000000000000000000000000000000000000..0a940122b176fc5f1f8c949de121028e2570812a --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/Creator.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="Creator" package="examples" version="1.0" author="ahbuss" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <StateVariable name="nextID" type="int"> + <Comment></Comment> + </StateVariable> + <Event name="Arrival"> + <Comment></Comment> + <StateTransition state="nextID"> + <Assignment value="nextID+1"/> + </StateTransition> + <Schedule delay="0.0" event="CustomerArrival" condition="true" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="nextID"/> + </Schedule> + <Code></Code> + <Coordinate x="30.0" y="120.0"/> + </Event> + <Event name="CustomerArrival"> + <Comment></Comment> + <Argument name="customer" type="Integer"/> + <Code></Code> + <Coordinate x="190.0" y="120.0"/> + </Event> + <Event name="Run"> + <Comment></Comment> + <StateTransition state="nextID"> + <Assignment value="0"/> + </StateTransition> + <Code></Code> + <Coordinate x="30.0" y="10.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/EntityCreator.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/EntityCreator.xml new file mode 100644 index 0000000000000000000000000000000000000000..10b34d4a8c1312808ac0be510904c31db7b7a8a8 --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/EntityCreator.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="EntityCreator" package="examples" version="$Id: EntityCreator.xml 1590 2007-10-07 05:41:19Z tdnorbra $" author="ahbuss" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Event name="Arrival"> + <Comment></Comment> + <Schedule delay="0.0" event="EntityArrival" condition="true" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="new simkit.Entity()"/> + </Schedule> + <Code></Code> + <Coordinate x="20.0" y="190.0"/> + </Event> + <Event name="EntityArrival"> + <Comment></Comment> + <Argument name="customer" type="simkit.Entity"/> + <Code></Code> + <Coordinate x="120.0" y="190.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/InventoryModel.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/InventoryModel.xml new file mode 100644 index 0000000000000000000000000000000000000000..9c83194ad7f48005630d888903860d1098b36123 --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/InventoryModel.xml @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="InventoryModel" package="examples" version="1.0" author="terry" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Comment>Implementation of an Event Graph for an Inventory Model employing an (s, S) ordering policy depicted on page 4-6 of the Discrete Event Simulation (DES) Modeling guide by Arnie Buss.</Comment> + <Parameter name="D" type="simkit.random.RandomVariate"> + <Comment>Number of Parts demanded by a customer</Comment> + </Parameter> + <Parameter name="tL" type="simkit.random.RandomVariate"> + <Comment>Lead time for orders received by the company</Comment> + </Parameter> + <Parameter name="tR" type="simkit.random.RandomVariate"> + <Comment>Deterministic time between company reviews</Comment> + </Parameter> + <Parameter name="I0" type="int"> + <Comment>Initial inventory of Parts</Comment> + </Parameter> + <Parameter name="bigS" type="int"> + <Comment>Order up to amount (S)</Comment> + </Parameter> + <Parameter name="littleS" type="int"> + <Comment>Order trigger amount (s)</Comment> + </Parameter> + <StateVariable name="I" type="int"> + <Comment>Amount of Parts on hand</Comment> + </StateVariable> + <StateVariable name="B" type="int"> + <Comment>Amount of Parts on backorder</Comment> + </StateVariable> + <StateVariable name="T" type="int"> + <Comment>Total amount of Parts on order</Comment> + </StateVariable> + <StateVariable name="N" type="int"> + <Comment>Number of Parts ordered</Comment> + </StateVariable> + <StateVariable name="NO" type="int"> + <Comment>Number of orders placed</Comment> + </StateVariable> + <StateVariable name="immediatelyServedCustomers" type="int"> + <Comment>Customers immediately served</Comment> + </StateVariable> + <Event name="Run" description="This event is fired first to facilitate initialization of all simulation state variables"> + <Comment></Comment> + <StateTransition state="I"> + <Assignment value="I0"/> + </StateTransition> + <StateTransition state="B"> + <Assignment value="0"/> + </StateTransition> + <StateTransition state="T"> + <Assignment value="0"/> + </StateTransition> + <StateTransition state="N"> + <Assignment value="0"/> + </StateTransition> + <StateTransition state="NO"> + <Assignment value="0"/> + </StateTransition> + <StateTransition state="immediatelyServedCustomers"> + <Assignment value="0"/> + </StateTransition> + <Schedule delay="tR.generate()" event="Review" priority="DEFAULT"> + <Comment></Comment> + </Schedule> + <Code></Code> + <Coordinate x="40.0" y="200.0"/> + </Event> + <Event name="Arrival"> + <Comment>Feeder event for schedulling the Demand event via Arrivals from the Arrival Process</Comment> + <Schedule delay="0.0" event="Demand" priority="DEFAULT"> + <Comment>Passing along tA</Comment> + </Schedule> + <Code></Code> + <Coordinate x="40.0" y="100.0"/> + </Event> + <Event name="Demand"> + <Comment></Comment> + <LocalVariable name="demand" type="int" value="((DiscreteRandomVariate) D).generateInt()"> + <Comment></Comment> + </LocalVariable> + <LocalVariable name="net" type="int" value="I-B-demand"> + <Comment></Comment> + </LocalVariable> + <StateTransition state="I"> + <Assignment value="Math.max(0, net)"/> + </StateTransition> + <StateTransition state="B"> + <Assignment value="Math.max(0, -net)"/> + </StateTransition> + <Code>firePropertyChange("demand", demand); + +if (net >= 0) { + int oldImmediatelyServedCustomers = immediatelyServedCustomers; + immediatelyServedCustomers += 1; + firePropertyChange("immediatelyServedCustomers", oldImmediatelyServedCustomers, immediatelyServedCustomers); +}</Code> + <Coordinate x="150.0" y="100.0"/> + </Event> + <Event name="Review"> + <Comment></Comment> + <Schedule delay="0.0" event="PlaceOrder" condition="(I-B+T) < littleS" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="bigS - I + B - T"/> + </Schedule> + <Schedule delay="tR.generate()" event="Review" priority="DEFAULT"> + <Comment></Comment> + </Schedule> + <Code></Code> + <Coordinate x="140.0" y="290.0"/> + </Event> + <Event name="PlaceOrder"> + <Comment></Comment> + <Argument name="A" type="int"/> + <StateTransition state="T"> + <Assignment value="T+A"/> + </StateTransition> + <StateTransition state="N"> + <Assignment value="N+A"/> + </StateTransition> + <StateTransition state="NO"> + <Assignment value="NO + 1"/> + </StateTransition> + <Schedule delay="tL.generate()" event="OrderArrives" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="A"/> + </Schedule> + <Code></Code> + <Coordinate x="280.0" y="300.0"/> + </Event> + <Event name="OrderArrives"> + <Comment></Comment> + <Argument name="A" type="int"/> + <LocalVariable name="net" type="int" value="I - B + A"> + <Comment></Comment> + </LocalVariable> + <StateTransition state="T"> + <Assignment value="T - A"/> + </StateTransition> + <StateTransition state="I"> + <Assignment value="Math.max(0, net)"/> + </StateTransition> + <StateTransition state="B"> + <Assignment value="Math.max(0, -net)"/> + </StateTransition> + <Code></Code> + <Coordinate x="400.0" y="300.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerGeneric.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerGeneric.xml new file mode 100644 index 0000000000000000000000000000000000000000..4023aa63f60e12d7ec40e00d7ea0d1d064b6af8f --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerGeneric.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="ServerGeneric" package="examples" version="$Id: ServerGeneric.xml 1590 2007-10-07 05:41:19Z tdnorbra $" author="ahbuss" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter name="totalNumberServers" type="int"> + <Comment></Comment> + </Parameter> + <Parameter name="serviceTimeGenerator" type="simkit.random.RandomVariate"> + <Comment></Comment> + </Parameter> + <StateVariable name="numberAvailableServers" type="int"> + <Comment></Comment> + </StateVariable> + <StateVariable name="queue" type="java.util.LinkedList<simkit.Entity>"> + <Comment></Comment> + </StateVariable> + <StateVariable name="delayInQueue" type="double"> + <Comment></Comment> + </StateVariable> + <StateVariable name="timeInSystem" type="double"> + <Comment></Comment> + </StateVariable> + <Event name="Run"> + <Comment></Comment> + <StateTransition state="numberAvailableServers"> + <Assignment value="totalNumberServers"/> + </StateTransition> + <StateTransition state="queue"> + <Assignment value="new java.util.LinkedList<simkit.Entity>()"/> + </StateTransition> + <Code></Code> + <Coordinate x="30.0" y="30.0"/> + </Event> + <Event name="Arrival"> + <Comment></Comment> + <Argument name="customer" type="simkit.Entity"/> + <StateTransition state="queue"> + <Operation method="add(customer)"/> + </StateTransition> + <Schedule delay="0.0" event="StartService" condition="numberAvailableServers > 0" priority="HIGH"> + <Comment></Comment> + </Schedule> + <Code>customer.stampTime();</Code> + <Coordinate x="30.0" y="170.0"/> + </Event> + <Event name="StartService"> + <Comment></Comment> + <StateTransition state="numberAvailableServers"> + <Assignment value="numberAvailableServers - 1"/> + </StateTransition> + <StateTransition state="queue"> + <Operation method="removeFirst()"/> + </StateTransition> + <StateTransition state="delayInQueue"> + <Assignment value="customer.getElapsedTime()"/> + </StateTransition> + <Schedule delay="serviceTimeGenerator.generate()" event="EndService" condition="true" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="customer"/> + </Schedule> + <Code>Entity customer = queue.getFirst();</Code> + <Coordinate x="170.0" y="160.0"/> + </Event> + <Event name="EndService"> + <Comment></Comment> + <Argument name="customer" type="simkit.Entity"/> + <StateTransition state="numberAvailableServers"> + <Assignment value="numberAvailableServers + 1"/> + </StateTransition> + <StateTransition state="timeInSystem"> + <Assignment value="customer.getElapsedTime()"/> + </StateTransition> + <Schedule delay="0.0" event="StartService" condition="queue.size() > 0" priority="HIGH"> + <Comment></Comment> + </Schedule> + <Code></Code> + <Coordinate x="290.0" y="160.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerWithReneges.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerWithReneges.xml new file mode 100644 index 0000000000000000000000000000000000000000..2a45c2bd0f20b63a5efcb715ed6e13fcf598911e --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/ServerWithReneges.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="ServerWithReneges" package="examples" version="0.1.5" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter name="numberServers" type="int"/> + <Parameter name="serviceTime" type="simkit.random.RandomVariate"/> + <Parameter name="renegeTime" type="simkit.random.RandomVariate"/> + <StateVariable name="numberAvailableServers" type="int"/> + <StateVariable name="queue" type="java.util.LinkedList<Integer>"/> + <StateVariable name="numberServed" type="int"/> + <StateVariable name="numberReneges" type="int"> + <Comment>this state variable stores the number of reneges</Comment> + <Comment>as a Java int.</Comment> + </StateVariable> + <Event name="Run"> + <Comment></Comment> + <StateTransition state="numberAvailableServers"> + <Assignment value="getNumberServers()"/> + </StateTransition> + <StateTransition state="queue"> + <Operation method="clear()"/> + </StateTransition> + <StateTransition state="numberServed"> + <Assignment value="0"/> + </StateTransition> + <StateTransition state="numberReneges"> + <Assignment value="0"/> + </StateTransition> + <Code></Code> + <Coordinate x="70.0" y="70.0"/> + </Event> + <Event name="Arrival"> + <Comment></Comment> + <Argument name="customer" type="java.lang.Integer"/> + <StateTransition state="queue"> + <Operation method="add(customer)"/> + </StateTransition> + <Schedule delay="renegeTime.generate()" event="Renege" priority="DEFAULT"> + <EdgeParameter value="customer"/> + </Schedule> + <Schedule delay="0.0" event="StartService" condition="getNumberAvailableServers() > 0" priority="DEFAULT"/> + <Code></Code> + <Coordinate x="70.0" y="160.0"/> + </Event> + <Event name="StartService"> + <LocalVariable name="customer" type="java.lang.Integer" value="queue.getFirst()"> + <Comment></Comment> + </LocalVariable> + <StateTransition state="queue"> + <Operation method="removeFirst()"/> + </StateTransition> + <StateTransition state="numberAvailableServers"> + <Assignment value="numberAvailableServers - 1"/> + </StateTransition> + <Cancel event="Renege"> + <EdgeParameter value="customer"/> + </Cancel> + <Schedule delay="serviceTime.generate()" event="EndService" priority="DEFAULT"> + <EdgeParameter value="customer"/> + </Schedule> + <Coordinate x="210.0" y="160.0"/> + </Event> + <Event name="EndService"> + <Argument name="customer1" type="java.lang.Integer"/> + <StateTransition state="numberAvailableServers"> + <Assignment value="numberAvailableServers+1"/> + </StateTransition> + <StateTransition state="numberServed"> + <Assignment value="numberServed+1"/> + </StateTransition> + <Schedule event="StartService" condition="queue.size() > 0" priority="HIGH"/> + <Coordinate x="340.0" y="160.0"/> + </Event> + <Event name="Renege"> + <Argument name="customer2" type="java.lang.Integer"/> + <StateTransition state="queue"> + <Operation method="remove(customer2)"/> + </StateTransition> + <StateTransition state="numberReneges"> + <Assignment value="numberReneges+1"/> + </StateTransition> + <Coordinate x="140.0" y="280.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleInventory.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleInventory.xml new file mode 100644 index 0000000000000000000000000000000000000000..b61049844fdc400b5c7ca62da0a672b9a5c76b67 --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleInventory.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="SimpleInventory" package="examples" version="0.1" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter name="timeBetweenDemands" type="simkit.random.RandomVariate"/> + <Parameter name="demand" type="simkit.random.RandomVariate"/> + <Parameter name="leadTime" type="simkit.random.RandomVariate"/> + <Parameter name="timeBetweenReviews" type="double"/> + <Parameter name="initialInventory" type="double"/> + <Parameter name="triggerPoint" type="double"/> + <Parameter name="orderUpTo" type="double"/> + <StateVariable name="inventoryPosition" type="double"/> + <StateVariable name="amountOnOrder" type="double"/> + <Event name="Run"> + <StateTransition state="inventoryPosition"> + <Assignment value="initialInventory"/> + </StateTransition> + <StateTransition state="amountOnOrder"> + <Assignment value="0"/> + </StateTransition> + <Schedule delay="timeBetweenReviews" event="Review" priority="DEFAULT"/> + <Schedule delay="timeBetweenDemands.generate()" event="Demand" priority="DEFAULT"/> + <Coordinate x="10.0" y="20.0"/> + </Event> + <Event name="Demand"> + <StateTransition state="inventoryPosition"> + <Assignment value="inventoryPosition - demand.generate()"/> + </StateTransition> + <Schedule delay="timeBetweenDemands.generate()" event="Demand" priority="DEFAULT"/> + <Coordinate x="160.0" y="20.0"/> + </Event> + <Event name="Review"> + <Schedule delay="0.0" event="PlaceOrder" condition="inventoryPosition + amountOnOrder < triggerPoint" priority="DEFAULT"> + <EdgeParameter value="(orderUpTo - inventoryPosition - amountOnOrder)"/> + </Schedule> + <Schedule delay="timeBetweenReviews" event="Review" priority="DEFAULT"/> + <Coordinate x="80.0" y="140.0"/> + </Event> + <Event name="PlaceOrder"> + <Argument name="newOrderAmount" type="double"/> + <StateTransition state="amountOnOrder"> + <Assignment value="amountOnOrder + newOrderAmount"/> + </StateTransition> + <Schedule delay="leadTime.generate()" event="ReceiveOrder" priority="DEFAULT"> + <EdgeParameter value="newOrderAmount"/> + </Schedule> + <Coordinate x="190.0" y="150.0"/> + </Event> + <Event name="ReceiveOrder"> + <Argument name="receivedOrderAmount" type="double"/> + <StateTransition state="amountOnOrder"> + <Assignment value="amountOnOrder - receivedOrderAmount"/> + </StateTransition> + <StateTransition state="inventoryPosition"> + <Assignment value="inventoryPosition + receivedOrderAmount"/> + </StateTransition> + <Coordinate x="310.0" y="150.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleMachineFailure.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleMachineFailure.xml new file mode 100644 index 0000000000000000000000000000000000000000..ad872c9652eb9cd6581ba5a65b3d4d4db021ad2b --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleMachineFailure.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="SimpleMachineFailure" version="0.1" package="examples" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter type="int" name="totalNumberMachines"/> + <Parameter type="int" name="totalNumberRepairPeople"/> + <Parameter type="simkit.random.RandomVariate" name="timeToFailure"/> + <Parameter type="simkit.random.RandomVariate" name="repairTime"/> + <StateVariable name="numberFailedMachines" type="int" /> + <StateVariable name="numberAvailableRepairPeople" type="int" /> + <Event name="Run"> + <StateTransition state="numberFailedMachines"> + <Assignment value="totalNumberMachines"/> + </StateTransition> + <StateTransition state="numberAvailableRepairPeople"> + <Assignment value="totalNumberRepairPeople"/> + </StateTransition> + <Schedule delay="0.0" event="StartMachine"/> + <Coordinate y="0" x="0"/> + </Event> + <Event name="StartMachine"> + <StateTransition state="numberFailedMachines"> + <Assignment value="numberFailedMachines - 1"/> + </StateTransition> + <Schedule delay="timeToFailure.generate()" event="Failure"/> + <Schedule condition="numberFailedMachines > 0" delay="0.0" event="StartMachine"/> + <Coordinate y="0" x="80"/> + </Event> + <Event name="Failure"> + <StateTransition state="numberFailedMachines"> + <Assignment value="numberFailedMachines + 1"/> + </StateTransition> + <Schedule condition="numberAvailableRepairPeople > 0" delay="0.0" event="StartRepair"/> + <Coordinate y="160" x="80"/> + </Event> + <Event name="StartRepair"> + <StateTransition state="numberAvailableRepairPeople"> + <Assignment value="numberAvailableRepairPeople - 1"/> + </StateTransition> + <Schedule delay="repairTime.generate()" event="EndRepair"/> + <Coordinate y="160" x="280"/> + </Event> + <Event name="EndRepair"> + <StateTransition state="numberAvailableRepairPeople"> + <Assignment value="numberAvailableRepairPeople + 1"/> + </StateTransition> + <StateTransition state="numberFailedMachines"> + <Assignment value="numberFailedMachines - 1"/> + </StateTransition> + <Schedule condition="numberFailedMachines >= totalNumberRepairPeople" priority="HIGH" delay="0.0" event="StartRepair"/> + <Schedule delay="timeToFailure.generate()" event="Failure"/> + <Coordinate y="10" x="280"/> + </Event> +</SimEntity> + diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleServer.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleServer.xml new file mode 100755 index 0000000000000000000000000000000000000000..36f199cd413fa1d3f777398ce8327a0dd9cdff7a --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/SimpleServer.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity name="SimpleServer" package="examples" version="0.1" extend="SimEntityBase" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter name="serviceTime" type="simkit.random.RandomVariate"/> + <Parameter name="totalNumberServers" type="int"/> + <StateVariable name="numberInQueue" type="int"/> + <StateVariable name="numberAvailableServers" type="int"/> + <Event name="Run"> + <StateTransition state="numberInQueue"> + <Assignment value="0"/> + </StateTransition> + <StateTransition state="numberAvailableServers"> + <Assignment value="totalNumberServers"/> + </StateTransition> + <Coordinate x="20.0" y="30.0"/> + </Event> + <Event name="Arrival"> + <StateTransition state="numberInQueue"> + <Assignment value="numberInQueue + 1"/> + </StateTransition> + <Schedule delay="0.0" event="StartService" condition="numberAvailableServers > 0" priority="DEFAULT"> + <Comment></Comment> + <EdgeParameter value="numberAvailableServers"/> + </Schedule> + <Coordinate x="20.0" y="130.0"/> + </Event> + <Event name="StartService"> + <Comment></Comment> + <Argument name="arg_0" type="int"/> + <StateTransition state="numberInQueue"> + <Assignment value="numberInQueue - 1"/> + </StateTransition> + <StateTransition state="numberAvailableServers"> + <Assignment value="numberAvailableServers - 1"/> + </StateTransition> + <Schedule delay="serviceTime.generate()" event="EndService" priority="DEFAULT"/> + <Code>System.out.println("numberAvailableServers"+arg_0);</Code> + <Coordinate x="160.0" y="130.0"/> + </Event> + <Event name="EndService"> + <StateTransition state="numberAvailableServers"> + <Assignment value="numberAvailableServers + 1"/> + </StateTransition> + <Schedule delay="0.0" event="StartService" condition="numberInQueue > 0" priority="HIGH"/> + <Coordinate x="330.0" y="130.0"/> + </Event> +</SimEntity> diff --git a/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/TransferLineComponent.xml b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/TransferLineComponent.xml new file mode 100644 index 0000000000000000000000000000000000000000..63bce207d2bcb60e15209ffd48e2487df9d6cafc --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/EventGraphs/examples/TransferLineComponent.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<SimEntity extend="SimEntityBase" name="TransferLineComponent" package="examples" version="0.0.2" xsi:noNamespaceSchemaLocation="http://diana.nps.edu/Simkit/simkit.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <Parameter name="totalNumberServers" type="int[]"/> + <Parameter name="serviceTime" type="simkit.random.RandomVariate[]"/> + <StateVariable name="numberAvailableServers" type="int[totalNumberServers.length]"/> + <StateVariable name="numberInQueue" type="int[totalNumberServers.length]"/> + <Event name="Run"> + <LocalVariable name="j" type="int" value="0"> + <Comment/> + </LocalVariable> + <LocalVariable name="_idxvar_0" type="int" value="0"> + <Comment>used internally</Comment> + </LocalVariable> + <LocalVariable name="_idxvar_1" type="int" value="0"> + <Comment>used internally</Comment> + </LocalVariable> + <StateTransition index="_idxvar_0" state="numberAvailableServers"> + <Assignment value="totalNumberServers[_idxvar_0]"/> + </StateTransition> + <StateTransition index="_idxvar_1" state="numberInQueue"> + <Assignment value="0"/> + </StateTransition> + <Schedule delay="0.0" event="InitializeWorkcenter"> + <EdgeParameter value="0"/> + </Schedule> + <Coordinate x="0" y="0"/> + </Event> + <Event name="InitializeWorkcenter"> + <Argument name="i" type="int"/> + <LocalVariable name="_idxvar_26" type="int" value="i"> + <Comment>used internally</Comment> + </LocalVariable> + <LocalVariable name="_idxvar_27" type="int" value="i"> + <Comment>used internally</Comment> + </LocalVariable> + <StateTransition index="_idxvar_26" state="numberInQueue"> + <Assignment value="0"/> + </StateTransition> + <StateTransition index="_idxvar_27" state="numberAvailableServers"> + <Assignment value="totalNumberServers[i]"/> + </StateTransition> + <Schedule condition="i < totalNumberServers.length - 1" event="InitializeWorkcenter"> + <EdgeParameter value="i+1"/> + </Schedule> + <Coordinate x="120" y="0"/> + </Event> + <Event name="Arrival"> + <Argument name="i" type="int"/> + <LocalVariable name="_idxvar_47" type="int" value="i"> + <Comment>used internally</Comment> + </LocalVariable> + <StateTransition index="_idxvar_47" state="numberInQueue"> + <Assignment value="numberInQueue[i] + 1"/> + </StateTransition> + <Schedule condition="getNumberAvailableServers(i) > 0" event="StartService"> + <EdgeParameter value="i"/> + </Schedule> + <Coordinate x="0" y="180"/> + </Event> + <Event name="StartService"> + <Argument name="i" type="int"/> + <LocalVariable name="_idxvar_48" type="int" value="i"> + <Comment>used internally</Comment> + </LocalVariable> + <LocalVariable name="_idxvar_49" type="int" value="i"> + <Comment>used internally</Comment> + </LocalVariable> + <StateTransition index="_idxvar_48" state="numberInQueue"> + <Assignment value="numberInQueue[i] + 1"/> + </StateTransition> + <StateTransition index="_idxvar_49" state="numberAvailableServers"> + <Assignment value="numberAvailableServers[i] - 1"/> + </StateTransition> + <Schedule delay="serviceTime[i].generate()" event="EndService"> + <EdgeParameter value="i"/> + </Schedule> + <Coordinate x="160" y="100"/> + </Event> + <Event name="EndService"> + <Argument name="i" type="int"/> + <LocalVariable name="_idxvar_50" type="int" value="i"> + <Comment>used internally</Comment> + </LocalVariable> + <StateTransition index="_idxvar_50" state="numberAvailableServers"> + <Assignment value="numberAvailableServers[i]+1"/> + </StateTransition> + <Schedule condition="getNumberInQueue(i) > 0" event="StartService"/> + <Schedule condition="i < totalNumberServers.length - 1" event="Arrival"/> + <Coordinate x="330" y="200"/> + </Event> +</SimEntity> \ No newline at end of file diff --git a/viskit/MyViskitProjects/DefaultProject/viskitProject.xml b/viskit/MyViskitProjects/DefaultProject/viskitProject.xml new file mode 100644 index 0000000000000000000000000000000000000000..1a7a1fb34bf2bcba5b570b67f0793a7e0b6c9c27 --- /dev/null +++ b/viskit/MyViskitProjects/DefaultProject/viskitProject.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViskitProject name="DefaultProject"> + <AnalystReports name="AnalystReports" /> + <AssembliesDirectory name="Assemblies" /> + <EventGraphsDirectory name="EventGraphs" /> + <BuildDirectory name="build"> + <ClassesDirectory name="classes" /> + <SourceDirectory name="src" /> + </BuildDirectory> + <DistDirectory name="dist" /> + <LibDirectory name="lib" /> + <Cached> + </Cached> +</ViskitProject> + diff --git a/viskit/RELEASE_NOTES b/viskit/RELEASE_NOTES new file mode 100644 index 0000000000000000000000000000000000000000..d94114650279b2d60b7d5bd20faf383134a22730 --- /dev/null +++ b/viskit/RELEASE_NOTES @@ -0,0 +1,251 @@ +Post release fixes / upgrades / issues: + + ***** ISSUES: + + Do to the nature of XML to Java translation, any derived class from a super + type must list the super type's fields in identical order so that type + matching can verify the super type for correct calls to super from the + derived translated java source. + + On Mac OS X 10.10.3 (Yosemite) & JDK 1.8.0_45, in the default L&F mode, while + inputting EG Parameters when the user selects more... to expose RandomVariate + types, a NPE will be thrown: + + at com.apple.laf.AquaMenuPainter.paintSelectedMenuItemBackground(AquaMenuPainter.java:153) + + Select the Platform L&F for OS X users as the work around. On Win machines, + the platform L&F is not the best choice as the background coloring for tabs is + quite quirky. The default L&F for Win machines is recommended. + + On Mac OS X 10.10.3 & JDK 1.8.0_45, the cancel and scheduling cursors on the + JGraph palette will revert back to the select cursor (arrow) when a node or + edge inspector pops up. If the user selects cancel or schedule mode again, + the cursor will not change (remains in select) mode until the user moves the + cursor out of the JPanel containing the JGraph component and menu bar up to + the parent Frame's title bar. Then it will change as expected. UPDATE: Haven't + seen this issue occur in later versions of JDK 17+ and later macOS versions. + TDN 19 FEB 2023. + + Due to the way the SimkitXML2Java generates EG extensions of super + SimEntities, a default constructor will not be generated in subclasses + accordingly. When it is time to parameterize EG constructors at Assy creation + time, an EG with a default (no arg) constructor will conveniently establish a + Random Variate Factory instance automatically within the Event Node Inspector. + A subclass of a SimEntity will not automatically establish a RVF instance, + therefore one must select the instantiation wizard, select "factory", accept + the change and then a RVF instance will be established and ready to accept + direct (String, Object...) inputs. + + At this time, the XML to Java translators cannot handle a super type generic + container declaration in XML, then instantiate it as a dynamic type, i.e. + List<String> list = new ArrayList<>(). The static declaration must match the + dynamic type accordingly. + + Because of the unique nature of XML IDs, we are not able to have similar + method names, i.e. Arrival, in an EG file even with differing method + signatures. As such, subclassing is still possible, but the user will have + to manually name Events in this manner using an underscore character, i.e. + Arrival, Arrival_e (where the "e" hints at the type argument of the event). + + If the CNTL key is held down while attempting to drag an edge control point + a IOOBE will be thrown by JGraph v5.14.0. This may be fixed in a subsequent + release of JGraphX (new code base name) should we decide to upgrade to v6+. + + If a single Assy file was closed, it will close all open EGs file including + non-associated EGs. This happens due to the EG caching system that relies on + parsing SimEntities of Assy files to know which EG to keep open. + + If one strays from the Java Bean convention of naming variables by starting + with a lower case letter, then be prepared to manually enter variable names + of interest when parameterizing a PropertyChangeListener edge such as a + SimplePropertyDumper as the PropertyDescriptor returned by the Introspector + will force lower case, i.e. variable int N will be returned as "n". + + BeanShell checking of code snippets was a good idea in the beginning, but + since we are only giving BeanShell a snippet and not the whole source file, it + can only perform very minor primitive checking and some instantiating checks + of generic containers. The compiler will notify of any errors at which time + the user can investigate and fix during EG or Assy authoring. + +7/23/24 (Critical) + Can place more than one scheduling edge between nodes + + (Minor) + + Placing a scheduling edge between two nodes does not immediately populate + the scheduling priority. If priority was missing on startup, or file + reopening, it gets placed then + + ****** FIXES / UPGRADES: + (Critical) + Fix issue where a leading "/" of a URL was hiding an additional classpath + jar on WIN. + + If a user submits a path to an assy file, and the file and current project + path do not coincide, then open the project that the assy belongs in. + + (Critical) + Fix issue where if another project was opened, lingering recent proj. file + references were maintained causing a NPE due to a recent class from the old + project which is no longer found on the current classpath. + + We now have a unicode character displayed on conditional scheduling edges + + (Critical) + Fixed runaway recursion when selecting a PCL for edit + + Better formatting on the Local run panel console output of rep. stats and + rep. summary report. + + Consolidated VertexRenderers for efficiency + + Control points for self scheduling edges now outline the offset edge shape + + Upgrade to JDOM v1.1.3 + + (Critical) + Fixed Log4j output to file. Using log4j2.xml config file. Console output is + now colorized per logging level. + + (Critical) + Selection of edges on macOS laptop displays was intermittent. Fix on + 13 DEC 22 did not take. Turns out all edges need a label, even if an empty + string. Null strings caused edge bounding box null issues which interfered + with proper bounding box / edge shape intersections. Overrode JGraph + EdgeRenderer intersect method to back off of deep dive Graphics2D hits to + find intersections between edge shape and their corresponding bounding + boxes. Replaced with simpler shape.intersects(rectangle) calls. No issues + now when working between MBP laptop displays and Mac Thunderbolt displays. + + (Critical) + https://groove.cs.utwente.nl/mac.html + Fixed accessabilityContext was null in JGraph. Needed a parent's Component + accessabilityContext + + On 05/03/24, moved main development work back to https://gitlab.nps.edu/Savage/viskit + + Updated most 3rd party libs, esp. Commons Config to fix File menu histories + not being retained for next start of the application. + + Simkit updated to v1.5.6 + + Fixed unit tests to run independently in their own ant target, some were + dormant. + + Tested on JDK 22.0.1 + + +Release: 1.0.16(December 13, 2022) +----------------------------------- +Major changes since 1.0.15 + + Fix to JAXB exception for not finding files from deleted project spaces. + + Fixed NPE from version attempting to read SVN strings, which are no longer + relevant since switching to git. + + Upgraded to latest JAXB. Bumped src release to 11 and tested to run on + JDK17+. + + In an attempt to maintain a clean/fresh classloader for each assy run (the + idea being that we don't want any previous static references to interfere + with independent runs), and since the inception of the Java Module Platform + System (JPMS), stripping out all but the "boot" class loader is accomplished + in the LocalBootLoader, thus preserving our goal of isolated class loaders. + + +Release: 1.0.15(June 08, 2015) +------------------------- +Major changes since 1.0.10: + + Moved codebase to new repository at: https://gitlab.nps.edu/tdnorbra/viskit + The codebase was forked at R2900 from the old SVN repository at: + https://eos.nps.edu/wcm/Viskit. Due to the many refactorings that took place + since R2900 (09 DEC 2015), R2900 marks the revision that was the last known + functional build of Viskit. Rather than branch at the original SVN site, it + was decided to move to a more functional repository for version control w/ + Git. + + EventNodes that are similarly named can be achieved using an underscore + character, i.e. Arrival, Arrival_e. The "e" would denote an event argument + name. The EventNode will graphically render correctly without the underscore + character and the generated java code will observe overloaded method names. + + We now label the name of the parameter in addition to its type for the Event + Graph Node Inspector Dialog's Instantiation Panels. This will aid in proper + EG parameterization + + JavaHelp contents now render external links. Update jhall.jar to v2.0_05 + to account for missing helper classes from v2.0.0. + + Config files for initial startup will now force the platform L&F for Macs and + leave the default L&F for Win and other machines. This is due to what is + described above under issues. + + Now using relative paths for all images generated for the Analyst Report + + +Release: 1.0.10(June 03, 2015) +------------------------- +Major changes since 1.0.5: + + Attempted to fix some buggy NPE within JGraph lib when running on Mac OS X + + +Release: 1.0.5(June 01, 2015) +------------------------- +Major changes since 1.0.0: + + Fixed NPE when unqualified names were being used for local variables as well + as in parameters. User is now notified to fix by stating qualified names. + + Fixed issue where user desires a specific replication to be verbose and only + that one in particular. If a specific rep. is given, that will uncheck the + verbose box + + Since canceling edges to nodes with parameters do not have to actually send + parameters, we've hidden the parameters sub-panel from the canceling edge + inspector + + Fixed NPE in the Source Window frame title when generating Assy source code + + Added support for when a user wishes to generate a statistical run report in + that when the report is ready for further editing/input by the user, the UI + will auto select to the analyst report tab + + Added support for the user to zip a current Viskit project, to include the + current debug.log, and email it to the Viskit mailing list + + Fixed and exception issue when verbose debug was selected from the Settings + dialog + + Fixed several menu activated NPEs when no EG or Assy files are loaded + + Implemented an Open Recent Projects menu item for the EventGraphViewFrame + + Added a header to the output replication report to better understand the order + of stats data presented. + + Fixed issue where designPointStats names were not being correctly set during + Assy. runtime causing a NPE and incorrect stat output due to name mismatches. + + Fixed an issue where the default Random Number Generator's seed reset call was + performed incorrectly and was unnecessary. The default RNG is the Mersenne + Twister with a seed state generated at instantiation time in Simkit with a + default seed. + + Fixed issue when a user used the Assy editor's recent project's list to + select a recent project and the selected project's title wasn't correctly + displayed. + + Added support for Object... (varargs) for the + RandomVariateFactor.getInstance(String, Object...) static Simkit method. We + can now write out java.lang.Object... to XML, parse it and apply it correctly + during SimEntity parameterization at Assy. creation time. + + Major refactor to implement a combo box selection for scheduling edge time + delays. Can now select parameters, local or argument vars and invoke methods, + or simply type in a delay value + + Fixed a potential NPE issue in the File Based Assembly Node (FBAN) when + parsing node files that are of *.class origin only and not XML diff --git a/viskit/RELEASE_NOTES_HISTORY b/viskit/RELEASE_NOTES_HISTORY new file mode 100644 index 0000000000000000000000000000000000000000..9bc24715666b80af7903629d74de8cbdba60bd38 --- /dev/null +++ b/viskit/RELEASE_NOTES_HISTORY @@ -0,0 +1,476 @@ +These are release notes for Viskit from 0.1 forward. Each release will +detail its functionality in meeting the applicable specifications and document +any known issues. + +Release: 1.0.0(March 10, 2015) +------------------------- +Major changes since 0.7.0: + + Major refactor of the MVC components to implement undo / redo on both the EG + and Assy editors + + Fixed potential NPE when attempting to capture a frame image with no file + loaded in either the EG or Assy. editors + + Further improvements to the state transitions panel in that when we wish to + invoke methods on state variables, a combo box of choices is presented. If a + method requires a parameter, the parameter is typed into the action field + + Fixed issue where canceling a local variable method call in the state + transition dialog did not initiate an auto row delete + + Improvements to the state transitions panel in that we can now invoke void + return type, zero parameter method calls as part of a state transition. This + is accomplished by declaring a local variable within an EventNode, or by using + an event argument supplied by an Edge. The type will be used to reflect on + which method types will be available for use on either the local variable, or + the argument + + Implemented capability to provide an unqualified Java class name and have the + fully qualified class found on the classpath. Implemented in viskit.VStatics + + Fixed bug to prevent edge parameter values from being wiped out during a node + modification + + Preventing a case where we have simkit.jar in both the working classpath and + in a project's /lib directory. We don't need to expose multiple libs of the + same name in the LEGOs tree because they happen to be in two different places + + Added a feature to the state transition panel whereby we can now assign local + variables to return type invoke on "." methods, i.e. boolean b = queue.add(E); + Before, we could only accomplish this type call and fire the state transition + manually via code block entries. This is a step in reducing code block usage. + + Fixed and issue where super type more than one level up were not being + resolved in the EG to Java translator + + Corrected issue with EG image capture being stuck on the last showing EG and + not cycling through open EG tabs + + Improved EG Node tooltips by including code blocks + + The translator for generation of Event Graph XML to Java now handles generic + array types as well as primitive array types, generic containers, and of + course, primitive types. + + JGraph extended and overridden components now behave like actual DES EG nodes + in that EG node edges take on the classic parabolic shape when two edges + connect between nodes. Self-referential edges now begin hear the top of the + node instead of at the bottom and form around the node in a clockwise fashion. + + Fixed issue with the StateVariableDialog where if an array type was entered in + the type field, the array length field was still disabled + + Fixed issue of the metadata description field not updating after an edit + + Fixed potential NPE in the PclEdgeInspectorDialog when the Introspector can't + determine a property type + + Fixed an issue where EG and Assy file open history was not being preserved + + Fixed an issue where a PropertyChangeListener edge with no selected property + was forcing a "" (empty string) property which is non-existent. + + Implemented a self-referential drag and drop, or menu selected canceling edge + option for the EG editor. + + Implemented an extension feature for EGs. Instead of extending the default + SimEntityBase, type in your SimEntityBase subclass name instead when creating + a new event graph, i.e. extends ArrivalProcess. + + Fixed an issue where and IllegalStateException would occur when added a + simkit.random.RandomVariate to the parameter list + + Fixed an issue with not being able to use normal java package naming + conventions when crafting EG package names + + Fixed an issue with cut & paste where the selected cache was not being cleared + after a confirmed delete by the user. + + Fixed a bug where canceling the edit on any of the Assembly edge dialogs + caused that edge to delete. + + Fixed an issue where a good intention to have nodes snap to grid on either + editor pallette caused the node cluster to keep positioning down and to the + right upon every file save. + +If an EG XML file save goes bad, or its corresponding source code +compilation reveals an error, the tab that represents the EG will change from +a green color (signifying good XML, good source compilation) to red which +signifies either an XML save, or its source compilation went bad. The user will +be unable to advance to the Assembly Editor tab until the problem is corrected. +If an EG compilation went bad, any previously compiled byte code *.class files +of the same name will be deleted preventing inclusion on the classpath. A bad +compile will also cause removal of the EG MD5 hash entry from the project's +viskitProject.xml file. If upon start up, a previously opened XML file passes +validation, but fails compilation, the user will again be unable to advance to +the Assy Editor tab. + + Fixed an issue where if a EG did not compile correctly, the whole EG LEGO tree + for would dissappear + + Bugfix 1425 + + More gracefully handle and inform the user of a missing third party library + + Fixed issue where if we had already compiled an Assembly, then the ClassLoader + has changed, and we need to go back and fix something in the Assembly. Switch + back to the Viskit ClassLoader and disable the Assembly Run tab until the + Assy is recompiled. + + Fixed timing issue when an Assembly file is given as an argument at startup + which firsts loads associated Event Graphs, but the Assembly was being + compiled before the Event Graphs finished loading causing ClassLoader issues + due to the Assembly being compiled in a separate ClassLoader. + + Shortened the path names for the LEGOs tree to be more readable. If the user + does not select the Analyst Report tab to be visible, then the Enable Analyst + Report checkbox on the Assembly Runner panel will not be enabled. + + Better Mac OS X installer support by upgrading the javaApplicationStub to work + better with Oracle's JDK 8+. Better Windows installer support by actually + getting it to work with the executable jar's Class-Path header. Still need to + fully test on Unix though. + + Implemented better message pop-up reporting during EG and Assy loading for the + user to better determine what errors have occurred + + Bugfix 1377 + + Allow deselection of both the Design of Experiments (DOE) and Cluster Run + panels via the Files -> Settings dialog -> Tabs Visible + + Ensure that when switching Event Graph tabs, or to the Assembly Editor, any + unsaved EGs will be saved, revalidated and re-compiled + + Remember user set sizes for the main app frame so that it will restart at + those dimensions + + Fix a long standing bug where modifications to EGs did not get re-validate + XML, generate java source, or re-compile. Fix bug where a duplicate icon + could reappear in the EG node pallette + + Fix UI issue where a node name could be changed for either an EG or Assy and + would not reflect until a mouse was re-clicked on the editor canvas + + Refactor source code packaging to more closely resemble MVC organization + +Release: 0.7.0(November 14, 2014) +------------------------- +Major changes since 0.6.2: + + Platform specific startup items are discerned at app startup, i.e. MAX OS X + "About Viskit" + + Fix a long standing bug where local variables declared in an EG doRun method + where not being utilized as indicies for arrays in state transition changes + + Enable a single click selection of a Viskit project icon w/o having to select + "OK" + + Upgrade to JAXB v2.2.11 + + Fix issue where a single opened EG did not close when selecting another Viskit + project + + If a user selects JVM exit and an EG, or Assy were modified, allow a cancel + closing Viskit when the save dialog appears + + Always show what Viskit project is open in the app title bar + + Implemented a nuke.dot.viskit Ant target. This is an attempt to draconically + fix an issue where Viskit startup in an unknown state via its .viskit kept + config files and can't recover to usability + + Fix bug to allow generically type arrays to be properly translated to java + source + + Fix a NPE in the AssemblyControllerImpl + + Had to break the "dirty Assembly" issue in the DOE's LocalBootLoader so as to + load generated and modified EGs and Assys from build/classes of each loaded + Viskit project. The documentation for viskit.doe.LocalBootLoader explains the + requirement for multi-threaded Grid Design Point Experiments to run with fresh + ClassLoader contexts. At this time, Grid (cluster) runs are disabled until + such time as we can re-implement using the Viskit Project paradigm + + Annotated a note in the InternalAssemblyRunner where the RandomVariate seed + was is being reset via reflection. This is critical in creating standalone + projects where they are run independently outside of the Viskit environment + + Upgrade to JGrpah 5.14.0. Improved threading on the drawing canvas, but need + to refine how the control points could make better scheduling edge arcs. + + Upgrade JAXB to 2.2+ + + Fix EG node cancel cursor bug issue + + Upgrade to Simkit v1.4.2 + + Fix issue with generating a lot of temp files and jars and not cleaning up + after the main app shuts down + + Implemented a completely enclosed runtime compilation scheme using the JDK's + runtime compiler for EG and Assy generated source code, thus removing the + requirement to ship the current JDK's tools.jar with the installers. A JDK is + still required to run Viskit though. + + Improve the whole Viskit app build process; must faster compile time + + Ensure that a Viskit project /lib populated with jars is read upon startup in + order to resolve external classpaths selected in the Setting Dialog + + Ensure the lib/ext can be ignored for pure Viskit operation, i.e. no + requirement for Diskit, or other advanced DES libs + + Upgrade to JDom v2.0.5 + + Upgrade to Xerces v2.11.0 + + Upgrade Apache Commons libs to v3.2.1 + + Fix NPE on model property editor + + Improve iZpack installer creation + +Release: 0.6.1(May 10, 2011) +--------------------------------- +Major changes since 0.6.0: + + Implemented a dedicated Viskit Project space "MyViskitProjects" in order to + properly designate a project space for specific user projects + + Fix NPE when canceling out of creating a project + + Fix bug where the Viskit Project file chooser was causing unnecessary + recursive calls + + Implemented a draconian runtime fix to nuke the ${user.home}/.viskit directory + incase of a startup failure that has historically rendered Viskit unusable + until .viskit was manually deleted anyway. The goal will be to never have to + do this if configuration metadata was stable enough to continue usability. + + Improved iZPack installer support for creating 64 bit installers. Shoe-horned + is a USA flag to denote "English" as an install language vice the UK flag. + + +Release: 0.6.0(October 8, 2010) +--------------------------------- +Major changes since 0.5.4: + + Upgrade to Simkit v1.3.8 + + Provide for launching Viskit either standalone, or as a process within another + runtime application observing proper EDT protocol + + Disable TRANG building of the EG and Assy Schema's from DTD. These Schemas + are now solid on their own. + + Fix bug where .svn folders would display on the LegosTree for SimEntities and + PropertyChangeListeners + + Bugfix 1248 + + Improved parsing for BasicSimEntity subclasses in order to populate the + LegosTree + + Display current Viskit Project name in the main app title bar + + Improved EG caching scheme so that we don't recompile unnecessarily + + Improved recently opened files and projects history caching + + Fix NPE bug when opening an existing Project from a newly installed Viskit + + Bugfix 706 + + Upgrade to JAXB v2.1.8 + + Improved output stream flushing when writing out to text at runtime + + Fix bug where EG description fields were not rendering for a newly added EG + tab + + Improved JDK shutdown if Viskit is a third-party lib within another app + + Bugfix 1364 + + Viskit was becoming too tightly integrated with a specific project (Savage + Studio). Broke up such dependencies and refactored to be a standalone app + that can be integrated into other applications. + + Fix issue where Assembly Adapter and PropertyChangeListener edges behave + properly if the user cancels an edit function + + The Assembly description field in not yet implemented and noted in source + + Assembly properties (metadata) are now immediately reflected in the Assembly + Runner + + The proper mode for a PropertyChangeListener is singular. However, for back- + wards compatibility for older EG, allow plural as well + + Fixed bug where improper GraphMetaData was being supplied to a new Assembly + + Fix issue where EG and Assy Editor toolbars were not being made visible when + creating new EGs and Assys + + Better resizing accomplished for the Assembly Editor to allow more weight to + the JGraph side of the splitpane + + Implemented full XML validation for EGs and Assy XML files + + Minor EG and Assy Schema modification to allow for SMAL metadata to be used + as CDATA entries + + Implemented multi-file opening choice for EGs and Assys + + Bugfixes 1396, 1398 & 1412 + + Fix issue to allow building of the ParameterMap and Constructor where no + concrete doRun or doReset methods were defined + + Implemented package creation when naming newly created EG and Assy files + + Implemented configuration awareness of current Viskit project + + Added a "Verbose" checkbox on each Assembly Node editor which operates as a + "detailed output." + + Clamp simulation output to 8M and truncate from the front if required + + Implemented dumping of Event List only if not in verbose, or reallyVerbose modes + + Internal class checking to populate EG editors unable to discern unqualified + class names except java.lang.* + + Viskit Project can now be stored and opened from any location on the local + machine + + Bugfixes 1400 & 1407 + + +Release: 0.5.4(August 12, 2008) +---------------------------------------- +Major changes since 0.5.3: + + Implement a clear recent files option to the File menus + + Implement a "detailed output" checkbox option for EG node inspector dialog + + Implement an incrementing trailing digit in node names when dragging new node + onto the Assembly editor canvas. Add check for existing node name prompting + use of the incrementing trailing digit. + + +Release: 0.5.3(August 5, 2008) +--------------------------------- +Major changes since 0.5.2: + + Implemented specific platform L&F options upon app startup + + Fix issue in SimkitXML2Java translator when an interrupt would cause an unclosed + if block statement causing startup compile errors + + Fix for issue where varargs can throw a mostly harmless compiler warning if + there is only one arg supplied to the SimkitXML2Java translator + + Fix issue where the EG inspector dialog "Apply" button had no effect + + Bugfix 1399 + + +Release: 0.5.2(June 11, 2008) +------------------------------- +Major changes since 0.4.8: + + Bugfixes 1402 & 1405 + + Implemented creating new projects from either the EG or Assy editor panel menus + + Bugfix 1373 + + Announce any compile errors to output screens + + +Release: 0.4.8(June 3, 2008) +------------------------------- +Major changes since 0.4.7: + + Implemented Log4J for debugging, output info status + + Switch from Sun's Base64 encoder to Apache version + + Fix NPE when user didn't check "Enabled Analyst Report" and attempted to view + anyway + + Fix bug where a SimplePropertyDumper could not co-exist with a + SimpleStatsTimeVarying PCL defined on the same Assembly + + Stricter BeanShell interpreter checking for EG and Assy authoring, esp. for + typed containers <SomeType> + + Enable regression line fitting to scatter plot graphs generated for the + Analyst Report + + Implemented enabling of the Assembly Run panel only after a successful Assy + compilation and validation. + + Implemented firing property changes using state variable "getters". Container + getters return a clone for the FPC in the doRun event. + + Modify the Assembly DTD to offer a raw count or mean of raw count statistic + for all PCL dialogs + + Implemented a "Number x of n Replications" output on the Assembly Runner + + Update JFreeChart to v1.2.0. Improve chart output by counting raw counts vice + the mean of raw counts for histogram charts + + Fix issue where Assys were being compiled while the EG tree was still being + parsed for compilation causing conflicts + + Upgrade Simkit to v1.3.4 + + Bugfix 1183 + + Improvements to Analyst Report building, editing, reopening and rendering in + HTML + + Implemented Ant targets to translate EGs and Assy XML files to Java source + + Further decoupling of Diskit being too tightly integrated w/ Viskit for + convenience of another application + + Refinements to external javac exec process for EGs and Assys + + Implemented generics utilzing JAXB v2.1. This is a whole Viskit upgrade + prompting tagging a pre-generics JAXB branch. + + Authored a script to delete temp files and history, a hack to clean up cruft + left behind from Viskit multiple operation of quarantining separate + classpaths, keeping scratch EG and Assy files, and multiple compilations of + source code. + + Implemented notification of when an Analyst Report is ready to view at the end + of a local Assembly Run of 1 or more replications + + Bugfixes 936, 1195, 1246, 1249 & 1260 + + Implemented figure caption auto increment in the Analyst Report. Xalan required + as 3rd party lib for this functionality + + Implemented a cleaner exit strategy vice a blunt System.exit(0) scheme + + Implemented image capturing of all opened EG and Assy files for PNG insertion + in the Analyst Report + + Improved Analyst Report generation by consolidating all material required for + report in a project specific location. Fix various bug discovered in AR + generation improvements. + + ****************************************************************************** + End of this report on Viskit history 26 SEP 2007. Please see + doc/viskitSVNLogs.txt for previous developer commit log entries dating back to + 18 NOV 2002 when Viskit migrated from CVS to SVN. + ****************************************************************************** diff --git a/viskit/Schemas/assembly.xsd b/viskit/Schemas/assembly.xsd new file mode 100644 index 0000000000000000000000000000000000000000..7f7c35038ebad2280bf07578af615e7534715995 --- /dev/null +++ b/viskit/Schemas/assembly.xsd @@ -0,0 +1,365 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- SVN ID: $Id$ --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xs:group name="DesignParameters"> + <xs:sequence> + <xs:element ref="TerminalParameter"/> + </xs:sequence> + </xs:group> + <xs:element name="ValueRange" abstract="true"> + <xs:complexType> + <xs:attribute name="lowValue"/> + <xs:attribute name="highValue"/> + </xs:complexType> + </xs:element> + <xs:group name="Parameters"> + <xs:choice> + <xs:element ref="MultiParameter"/> + <xs:element ref="FactoryParameter"/> + <xs:element ref="TerminalParameter"/> + </xs:choice> + </xs:group> + <xs:element name="Statistics" abstract="true"/> + <xs:element name="SimkitAssembly"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="head"/> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="DesignParameters"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="SimEntity"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="EventGraph"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="PropertyChangeListener"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="SimEventListenerConnection"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="PropertyChangeListenerConnection"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Adapter"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Output"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Verbose"/> + <xs:element minOccurs="0" ref="Schedule"/> + <xs:element minOccurs="0" ref="Experiment"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="version" default="1.0"/> + <xs:attribute name="package" use="required"/> + <xs:attribute name="author"/> + <xs:attribute name="extend" default="viskit.assembly.ViskitAssembly"/> + <xs:attribute name="implement"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="head"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="meta"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="meta"> + <xs:complexType> + <xs:attribute name="name" use="required"/> + <xs:attribute name="content"/> + </xs:complexType> + </xs:element> + <xs:element name="SimEntity"> + <xs:complexType> + <xs:sequence> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" use="required"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="url"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="TerminalParameter"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="ValueRange"/> + </xs:sequence> + <xs:attribute name="name"/> + <xs:attribute name="linkRef" type="xs:IDREF"/> + <xs:attribute name="link" type="xs:ID"/> + <xs:attribute name="value"/> + <xs:attribute name="type" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="DoubleRange" substitutionGroup="ValueRange"/> + <xs:element name="IntegerRange" substitutionGroup="ValueRange"/> + <xs:element name="MultiParameter"> + <xs:complexType> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:attribute name="name"/> + <xs:attribute name="type" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="FactoryParameter"> + <xs:complexType> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:attribute name="name"/> + <xs:attribute name="factory" use="required"/> + <xs:attribute name="method" default="getInstance"/> + <xs:attribute name="type" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="Coordinate"> + <xs:complexType> + <xs:attribute name="x" use="required"/> + <xs:attribute name="y" use="required"/> + </xs:complexType> + </xs:element> + <!-- + The proper mode for a PropertyChangeListener is singular, however, for + backwards compatibility with older EventGraphs, we allow both singular and + plural modes (tdn 16 SEP 2008) + --> + <xs:element name="PropertyChangeListener"> + <xs:complexType> + <xs:sequence> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="mode" default="listener"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="replicationStat"/> + <xs:enumeration value="replicationStats"/> + <xs:enumeration value="designPointStat"/> + <xs:enumeration value="designPointStats"/> + <xs:enumeration value="listener"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="meanStatistics" default="false"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="countStatistics" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="SimEventListenerConnection"> + <xs:complexType> + <xs:attribute name="listener" use="required"/> + <xs:attribute name="source" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="PropertyChangeListenerConnection"> + <xs:complexType> + <xs:attribute name="property"/> + <xs:attribute name="listener" use="required"/> + <xs:attribute name="source" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Output"> + <xs:complexType> + <xs:attribute name="entity" use="required" type="xs:NMTOKEN"/> + </xs:complexType> + </xs:element> + <xs:element name="Verbose"> + <xs:complexType> + <!-- Bugfix 1425 (xs:NMTOKEN) --> + <xs:attribute name="entity" use="required" type="xs:NMTOKEN"/> + </xs:complexType> + </xs:element> + <xs:element name="Schedule"> + <xs:complexType> + <xs:attribute name="stopTime" default="0.0"/> + <xs:attribute name="verbose" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="numberReplications" default="1"/> + <xs:attribute name="printReplicationReports" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="printSummaryReport" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="saveReplicationData" default="false"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="Adapter"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" use="required"/> + <xs:attribute name="eventHeard" use="required"/> + <xs:attribute name="eventSent" use="required"/> + <xs:attribute name="from" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="to" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Log" type="xs:string"/> + <xs:element name="Errors" type="xs:string"/> + <xs:element name="PropertyChange"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Statistics"/> + </xs:sequence> + <xs:attribute name="listenerName" use="required"/> + <xs:attribute name="property"/> + </xs:complexType> + </xs:element> + <xs:element name="SampleStatistics" substitutionGroup="Statistics"> + <xs:complexType> + <xs:attribute name="name"/> + <xs:attribute name="mean" default="0.0"/> + <xs:attribute name="variance" default="0.0"/> + <xs:attribute name="standardDeviation" default="0.0"/> + <xs:attribute name="count" default="0"/> + <xs:attribute name="minObs" default="0.0"/> + <xs:attribute name="maxObs" default="0.0"/> + <xs:attribute name="samplingType" default="TALLY"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="TALLY"/> + <xs:enumeration value="TIME_VARYING"/> + <xs:enumeration value="LINEAR"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="IndexedSampleStatistics" substitutionGroup="Statistics"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="SampleStatistics"/> + </xs:sequence> + <xs:attribute name="name"/> + </xs:complexType> + </xs:element> + <xs:element name="Results"> + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="Log"/> + <xs:element ref="PropertyChange"/> + <xs:element ref="Errors"/> + </xs:choice> + <xs:attribute name="sample" use="required"/> + <xs:attribute name="designPoint" use="required"/> + <xs:attribute name="index"/> + <xs:attribute name="job"/> + </xs:complexType> + </xs:element> + <xs:element name="DesignPoint"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="TerminalParameter"/> + <xs:element minOccurs="0" ref="Script"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Replication"/> + <xs:element minOccurs="0" ref="Results"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Statistics"/> + </xs:sequence> + <xs:attribute name="index"/> + </xs:complexType> + </xs:element> + <xs:element name="Replication"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Statistics"/> + </xs:sequence> + <xs:attribute name="index"/> + </xs:complexType> + </xs:element> + <xs:element name="Script" type="xs:string"/> + <xs:element name="Sample"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="DesignPoint"/> + </xs:sequence> + <xs:attribute name="index"/> + </xs:complexType> + </xs:element> + <xs:element name="Experiment"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="Script"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Sample"/> + </xs:sequence> + <xs:attribute name="jobID"/> + <xs:attribute name="type" default="latin-hypercube"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="latin-hypercube"/> + <xs:enumeration value="full-factorial"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="replicationsPerDesignPoint" default="1"/> + <xs:attribute name="totalSamples" default="1"/> + <xs:attribute name="jitter" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="timeout" default="0"/> + <xs:attribute name="debug" default="false"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="EventGraph"> + <xs:complexType mixed="true"> + <xs:attribute name="fileName"/> + </xs:complexType> + </xs:element> + <xs:element name="PasswordFile"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="User"/> + </xs:sequence> + <xs:attribute name="name" default="/tmp/passwd.xml"/> + </xs:complexType> + </xs:element> + <xs:element name="User"> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="password" use="required"/> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/viskit/Schemas/cli.xsd b/viskit/Schemas/cli.xsd new file mode 100644 index 0000000000000000000000000000000000000000..14a902bacd0a1e5a00d3c76cfbaa68447b744058 --- /dev/null +++ b/viskit/Schemas/cli.xsd @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xs:element name="Config"> + <xs:complexType> + <xs:sequence> + <xs:element ref="Assembly"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="EventGraph"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="ExtensionJar"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Assembly"> + <xs:complexType> + <xs:attribute name="fileName" use="required"/> + <xs:attribute name="className" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="EventGraph"> + <xs:complexType> + <xs:attribute name="fileName" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="ExtensionJar"> + <xs:complexType> + <xs:attribute name="fileName" use="required"/> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/viskit/Schemas/qstat.xsd b/viskit/Schemas/qstat.xsd new file mode 100644 index 0000000000000000000000000000000000000000..a8b58d5aca2d908db95a92563828d4961d5f7291 --- /dev/null +++ b/viskit/Schemas/qstat.xsd @@ -0,0 +1,238 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:ns="http://xml.netbeans.org/examples/targetNS" + targetNamespace="http://xml.netbeans.org/examples/targetNS" + xmlns="http://xml.netbeans.org/examples/targetNS" + elementFormDefault="qualified"> + + +<!-- + Document : qstat.xsd + Created on : March 14, 2006, 4:39 PM + Author : Rick Goldberg + Description: qstat -xml format + Licensed from Sun Grid Engine. +--> + + + +<!--___INFO__MARK_BEGIN__ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * the Sun Industry Standards Source License Version 1.2 + * + * Sun Microsystems Inc., March, 2001 + * + * + * Sun Industry Standards Source License Version 1.2 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.2 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2001 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + ************************************************************************/ +___INFO__MARK_END__--> + + + <xsd:element name="job_info"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation> + This schema describes most of the qstat outputs. There are extra + schema defintions for "qstat -j" and and "qstat -j job". + </xsd:documentation> + </xsd:annotation> + <xsd:sequence> + <xsd:element name="queue_info" type="queue_info_t" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="job_info" type="job_info_t" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="cluster_queue_summary" type="cqueue_summary_t" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + +<!-- ======================================= --> +<!-- general qstat output --> + + <xsd:element name="cqueue_summary_t"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:sequence> + <xsd:element name="name" type="xsd:String"/> + <xsd:element name="used" type="xsd:positiveInteger"/> + <xsd:element name="available" type="xsd:positiveInteger"/> + <xsd:element name="total" type="xsd:positiveInteger"/> + <xsd:element name="temp_disabled" type="xsd:positiveInteger"/> + <xsd:element name="manual_intervention" type="xsd:positiveInteger"/> + + <xsd:element name="suspend_manual" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="suspend_threshold" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="suspend_on_subordinate" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="suspend_calendar" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="unknown" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="load_alarm" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="disabled_manual" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="disabled_calendar" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="ambiguous" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="orphaned" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="error" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="queue_info_t"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:sequence> + <xsd:element name="name" type="xsd:String" minOccurs="0" maxOccurs="1"/> + <xsd:element name="qtype" type="xsd:String" minOccurs="0" maxOccurs="1"/> + <xsd:element name="slots_used" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="slots_total" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="load_avg" type="xsd:float" minOccurs="0" maxOccurs="1"/> + <xsd:element name="arch" type="xsd:String" minOccurs="0" maxOccurs="1"/> + <xsd:element name="state" type="xsd:String" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="message" type="xsd:String" minOccurs="0" maxOccurs="unbounded"/> + + <xsd:element name="resource" type="resource_t" minOccurs="0" maxOccurs="unbounded"/> + + <xsd:element name="job_list" type="job_list_t" minOccurs="0" maxOccurs="unbounded"/> + + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="job_info_t"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:sequence> + <xsd:element name="job_list" type="job_list_t" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> + + <xsd:element name="job_list_t"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:sequence> + <xsd:element name="JB_job_number" type="xsd:positiveInteger"/> + <xsd:element name="JAT_prio" type="xsd:float"/> + <xsd:element name="JAT_ntix" type="xsd:float" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="JB_nurg" type="xsd:float" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_urg" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_rrcontr" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_wtcontr" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_dlcontr" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_priority" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="JB_name" type="xsd:String"/> + <xsd:element name="JB_owner" type="xsd:String"/> + <xsd:element name="JB_project" type="xsd:String" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_department" type="xsd:String" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="state" type="xsd:String"/> + + <xsd:element name="JB_submission_time" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JAT_start_time" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_deadline" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="cpu_usage" type="xsd:float" minOccurs="0" maxOccurs="1"/> + <xsd:element name="mem_usage" type="xsd:float" minOccurs="0" maxOccurs="1"/> + <xsd:element name="io_usage" type="xsd:float" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="tickets" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_override_tickets" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_jobshare" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="otickets" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="ftickets" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="stickets" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JAT_share" type="xsd:float" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="queue_name" type="xsd:String" minOccurs="0" maxOccurs="1"/> + <xsd:element name="master" type="xsd:String" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="slots" type="xsd:positiveInteger"/> + <xsd:element name="tasks" type="xsd:String" minOccurs="0" maxOccurs="1"/> + + <xsd:element name="requested_PE" type="requested_PE_t" minOccurs="0" maxOccurs="1"/> + <xsd:element name="granted_PE" type="granted_PE_t" minOccurs="0" maxOccurs="1"/> + <xsd:element name="JB_checkpoint_name" type="xsd:String" minOccurs="0" maxOccurs="1"/> + <xsd:element name="hard_request" type="request_t" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="def_hard_request" type="request_t" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="soft_request" type="request_t" minOccurs="0" maxOccurs="unbounded"/> + + <xsd:element name="hard_req_queue" type="xsd:String" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="soft_req_queue" type="xsd:String" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="master_hard_req_queue" type="xsd:String" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="predecessor_jobs_req" type="xsd:String" minOccurs="0" maxOccurs="unbounded"/> + <xsd:element name="predecessor_jobs" type="xsd:positiveInteger" minOccurs="0" maxOccurs="unbounded"/> + + </xsd:sequence> + <xsd:attribute name="state" type="xsd:string" use="required"/> + </xsd:complexType> + </xsd:element> + +<!-- ======================================= --> + + <xsd:element name="request_t" type="xsd:string"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="name" type="xsd:string" use="required"/> + <xsd:attribute name="resource_contribution" type="xsd:float" use="implied"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="granted_PE_t" type="xsd:positiveInteger"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="name" type="xsd:string" use="required"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="requested_PE_t" type="xsd:string"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="name" type="xsd:string" use="required"/> + </xsd:complexType> + </xsd:element> + + <xsd:element name="resource_t" type="xsd:string"> + <xsd:complexType> + <xsd:annotation> + <xsd:documentation></xsd:documentation> + </xsd:annotation> + <xsd:attribute name="name" type="xsd:string" use="required"/> + <xsd:attribute name="type" type="xsd:string" use="required"/> + </xsd:complexType> + </xsd:element> + +</xsd:schema> diff --git a/viskit/Schemas/simkit.xsd b/viskit/Schemas/simkit.xsd new file mode 100644 index 0000000000000000000000000000000000000000..5764da8d5a8823458fcde2751d39633f08df1399 --- /dev/null +++ b/viskit/Schemas/simkit.xsd @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- SVN ID: $Id$ --> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xs:element name="SimEntity"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="head"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Parameter"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="StateVariable"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Event"/> + <xs:element minOccurs="0" ref="Code"/> + </xs:sequence> + <xs:attribute name="name" use="required"/> + <xs:attribute name="package" default="examples"/> + <xs:attribute name="version" default="1.0"/> + <xs:attribute name="author"/> + <xs:attribute name="extend" default="SimEntityBase"/> + <xs:attribute name="implement"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="head"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="meta"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="meta"> + <xs:complexType> + <xs:attribute name="name" use="required"/> + <xs:attribute name="content"/> + </xs:complexType> + </xs:element> + <xs:element name="Comment" type="xs:string"/> + <xs:element name="Parameter"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="StateVariable"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Event"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Argument"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="LocalVariable"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="StateTransition"/> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="Schedule"/> + <xs:element ref="Cancel"/> + </xs:choice> + + <!-- Regardless of this sequence, code blocks will appear in the correct + place in generated source code --> + <xs:element minOccurs="0" ref="Code"/> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Code" type="xs:string"/> + <xs:element name="Argument"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="LocalVariable"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="value"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Coordinate"> + <xs:complexType> + <xs:attribute name="x" use="required"/> + <xs:attribute name="y" use="required"/> + </xs:complexType> + </xs:element> + <xs:element name="Operation"> + <xs:complexType> + <xs:attribute name="method" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Assignment"> + <xs:complexType> + <xs:attribute name="value" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="LocalVariableAssignment"> + <xs:complexType> + <xs:attribute name="value"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="LocalVariableInvocation"> + <xs:complexType> + <xs:attribute name="method"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <!-- bug fix 1183 --> + <xs:element name="StateTransition"> + <xs:complexType> + <xs:sequence> + <xs:choice> + <xs:element ref="Assignment"/> + <xs:element ref="Operation"/> + </xs:choice> + <xs:element minOccurs="0" maxOccurs="1" ref="LocalVariableAssignment"/> + <xs:element minOccurs="0" maxOccurs="1" ref="LocalVariableInvocation"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + </xs:sequence> + <xs:attribute name="state" use="required" type="xs:IDREF"/> + <xs:attribute name="index"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="EdgeParameter"> + <xs:complexType> + <xs:attribute name="value" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Schedule"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="EdgeParameter"/> + </xs:sequence> + <xs:attribute name="delay" default="0.0"/> + <xs:attribute name="event" use="required" type="xs:IDREF"/> + <xs:attribute name="condition"/> + <xs:attribute name="priority" default="DEFAULT"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="HIGHEST"/> + <xs:enumeration value="HIGHER"/> + <xs:enumeration value="HIGH"/> + <xs:enumeration value="DEFAULT"/> + <xs:enumeration value="LOW"/> + <xs:enumeration value="LOWER"/> + <xs:enumeration value="LOWEST"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Cancel"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="EdgeParameter"/> + </xs:sequence> + <xs:attribute name="event" use="required" type="xs:IDREF"/> + <xs:attribute name="condition"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/viskit/Schemas/statistics.xsd b/viskit/Schemas/statistics.xsd new file mode 100644 index 0000000000000000000000000000000000000000..ec587670f213ea0535a1cb836ecdfcfa2578cedb --- /dev/null +++ b/viskit/Schemas/statistics.xsd @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <xs:element name="SampleStatistics"> + <xs:complexType> + <xs:attribute name="mean" default="0.0" type="xs:decimal"/> + <xs:attribute name="variance" default="0.0" type="xs:decimal"/> + <xs:attribute name="standardDeviation" default="0.0" type="xs:decimal"/> + <xs:attribute name="count" default="0" type="xs:integer"/> + <xs:attribute name="minObs" default="0.0" type="xs:decimal"/> + <xs:attribute name="maxObs" default="0.0" type="xs:decimal"/> + <xs:attribute name="sampleType" default="TALLY"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="TALLY"/> + <xs:enumeration value="TIME_VARYING"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="name"/> + </xs:complexType> + </xs:element> + <xs:element name="IndexedSampleStatistics"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="SampleStatistics"/> + </xs:sequence> + <xs:attribute name="name"/> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/viskit/Schemas/viskit.xsd b/viskit/Schemas/viskit.xsd new file mode 100644 index 0000000000000000000000000000000000000000..867ea3c631a759219202fae16f71f03ab3cc6098 --- /dev/null +++ b/viskit/Schemas/viskit.xsd @@ -0,0 +1,541 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + <!-- this is next-generation merged schema, work in progress, not yet used --> + <!-- change: renamed simkit.xsd (dissimilar) Schedule as AssemblySchedule --> + <!-- change: renamed assembly.xsd (dissimilar) SimEntity as AssemblySimEntity --> + <!-- assembly.xsd ============================================= --> + <xs:group name="DesignParameters"> + <xs:sequence> + <xs:element ref="TerminalParameter"/> + </xs:sequence> + </xs:group> + <xs:element name="ValueRange" abstract="true"> + <xs:complexType> + <xs:attribute name="lowValue"/> + <xs:attribute name="highValue"/> + </xs:complexType> + </xs:element> + <xs:group name="Parameters"> + <xs:choice> + <xs:element ref="MultiParameter"/> + <xs:element ref="FactoryParameter"/> + <xs:element ref="TerminalParameter"/> + </xs:choice> + </xs:group> + <xs:element name="Statistics" abstract="true"/> + <xs:element name="SimkitAssembly"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="head"/> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="DesignParameters"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="AssemblySimEntity"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="EventGraph"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="PropertyChangeListener"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="SimEventListenerConnection"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="PropertyChangeListenerConnection"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Adapter"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Output"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Verbose"/> + <xs:element minOccurs="0" ref="Schedule"/> + <xs:element minOccurs="0" ref="Experiment"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="version" default="1.0"/> + <xs:attribute name="package" use="required"/> + <xs:attribute name="author"/> + <xs:attribute name="extend" default="viskit.assembly.ViskitAssembly"/> + <xs:attribute name="implement"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="head"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="meta"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="meta"> + <xs:complexType> + <xs:attribute name="name" type="xs:NMTOKEN" use="required"/> + <xs:attribute name="content"/> + </xs:complexType> + </xs:element> + <xs:element name="AssemblySimEntity"> + <xs:complexType> + <xs:sequence> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" type="xs:NMTOKEN" use="required"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="url"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="TerminalParameter"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="ValueRange"/> + </xs:sequence> + <xs:attribute name="name"/> + <xs:attribute name="linkRef" type="xs:IDREF"/> + <xs:attribute name="link" type="xs:ID"/> + <xs:attribute name="value"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="DoubleRange" substitutionGroup="ValueRange"/> + <xs:element name="IntegerRange" substitutionGroup="ValueRange"/> + <xs:element name="MultiParameter"> + <xs:complexType> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:attribute name="name"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="FactoryParameter"> + <xs:complexType> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:attribute name="name"/> + <xs:attribute name="factory" use="required"/> + <xs:attribute name="method" default="getInstance"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Coordinate"> + <xs:complexType> + <xs:attribute name="x" use="required"/> <!-- TODO type="xs:float" --> + <xs:attribute name="y" use="required"/> <!-- TODO type="xs:float" --> + </xs:complexType> + </xs:element> + <!-- + The proper mode for a PropertyChangeListener is singular, however, for + backwards compatibility with older EventGraphs, we allow both singular and + plural modes (tdn 16 SEP 2008) + --> + <xs:element name="PropertyChangeListener"> + <xs:complexType> + <xs:sequence> + <xs:group minOccurs="0" maxOccurs="unbounded" ref="Parameters"/> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="mode" default="listener"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="replicationStat"/> + <xs:enumeration value="replicationStats"/> + <xs:enumeration value="designPointStat"/> + <xs:enumeration value="designPointStats"/> + <xs:enumeration value="listener"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="meanStatistics" default="false"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="countStatistics" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="SimEventListenerConnection"> + <xs:complexType> + <xs:attribute name="listener" use="required"/> + <xs:attribute name="source" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="PropertyChangeListenerConnection"> + <xs:complexType> + <xs:attribute name="property"/> + <xs:attribute name="listener" use="required"/> + <xs:attribute name="source" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Output"> + <xs:complexType> + <xs:attribute name="entity" use="required" type="xs:NMTOKEN"/> + </xs:complexType> + </xs:element> + <xs:element name="Verbose"> + <xs:complexType> + <!-- Bugfix 1425 (xs:NMTOKEN) --> + <xs:attribute name="entity" use="required" type="xs:NMTOKEN"/> + </xs:complexType> + </xs:element> + <xs:element name="Schedule"> + <xs:complexType> + <xs:attribute name="stopTime" default="0.0"/> + <xs:attribute name="verbose" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="numberReplications" default="1"/> + <xs:attribute name="printReplicationReports" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="printSummaryReport" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="saveReplicationData" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="AssemblySchedule"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="EdgeParameter"/> + </xs:sequence> + <xs:attribute name="delay" default="0.0"/> + <xs:attribute name="event" use="required" type="xs:IDREF"/> + <xs:attribute name="condition"/> + <xs:attribute name="priority" default="DEFAULT"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="HIGHEST"/> + <xs:enumeration value="HIGHER"/> + <xs:enumeration value="HIGH"/> + <xs:enumeration value="DEFAULT"/> + <xs:enumeration value="LOW"/> + <xs:enumeration value="LOWER"/> + <xs:enumeration value="LOWEST"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Adapter"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" type="xs:NMTOKEN" use="required"/> + <xs:attribute name="eventHeard" use="required"/> + <xs:attribute name="eventSent" use="required"/> + <xs:attribute name="from" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="to" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Log" type="xs:string"/> + <xs:element name="Errors" type="xs:string"/> + <xs:element name="PropertyChange"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Statistics"/> + </xs:sequence> + <xs:attribute name="listenerName" use="required"/> + <xs:attribute name="property"/> + </xs:complexType> + </xs:element> + <xs:element name="SampleStatistics" substitutionGroup="Statistics"> + <xs:complexType> + <xs:attribute name="name"/> + <xs:attribute name="mean" default="0.0"/> + <xs:attribute name="variance" default="0.0"/> + <xs:attribute name="standardDeviation" default="0.0"/> + <xs:attribute name="count" default="0"/> + <xs:attribute name="minObs" default="0.0"/> + <xs:attribute name="maxObs" default="0.0"/> + <xs:attribute name="samplingType" default="TALLY"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="TALLY"/> + <xs:enumeration value="TIME_VARYING"/> + <xs:enumeration value="LINEAR"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="IndexedSampleStatistics" substitutionGroup="Statistics"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="SampleStatistics"/> + </xs:sequence> + <xs:attribute name="name"/> + </xs:complexType> + </xs:element> + <xs:element name="Results"> + <xs:complexType> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="Log"/> + <xs:element ref="PropertyChange"/> + <xs:element ref="Errors"/> + </xs:choice> + <xs:attribute name="sample" use="required"/> + <xs:attribute name="designPoint" use="required"/> + <xs:attribute name="index"/> + <xs:attribute name="job"/> + </xs:complexType> + </xs:element> + <xs:element name="DesignPoint"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="TerminalParameter"/> + <xs:element minOccurs="0" ref="Script"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Replication"/> + <xs:element minOccurs="0" ref="Results"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Statistics"/> + </xs:sequence> + <xs:attribute name="index"/> + </xs:complexType> + </xs:element> + <xs:element name="Replication"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Statistics"/> + </xs:sequence> + <xs:attribute name="index"/> + </xs:complexType> + </xs:element> + <xs:element name="Script" type="xs:string"/> + <xs:element name="Sample"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="DesignPoint"/> + </xs:sequence> + <xs:attribute name="index"/> + </xs:complexType> + </xs:element> + <xs:element name="Experiment"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="Script"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Sample"/> + </xs:sequence> + <xs:attribute name="jobID"/> + <xs:attribute name="type" default="latin-hypercube"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="latin-hypercube"/> + <xs:enumeration value="full-factorial"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="replicationsPerDesignPoint" default="1"/> + <xs:attribute name="totalSamples" default="1"/> + <xs:attribute name="jitter" default="true"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="timeout" default="0"/> + <xs:attribute name="debug" default="false"> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + </xs:complexType> + </xs:element> + <xs:element name="EventGraph"> + <xs:complexType mixed="true"> + <xs:attribute name="fileName"/> + </xs:complexType> + </xs:element> + <xs:element name="PasswordFile"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="User"/> + </xs:sequence> + <xs:attribute name="name" default="/tmp/passwd.xml"/> + </xs:complexType> + </xs:element> + <xs:element name="User"> + <xs:complexType> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="password" use="required"/> + </xs:complexType> + </xs:element> + <!-- simkit.xsd ============================================ --> + <xs:element name="SimEntity"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" ref="head"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Parameter"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="StateVariable"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Event"/> + <xs:element minOccurs="0" ref="Code"/> + </xs:sequence> + <xs:attribute name="name" type="xs:NMTOKEN" use="required"/> + <xs:attribute name="package" default="examples"/> + <xs:attribute name="version" default="1.0"/> + <xs:attribute name="author"/> + <xs:attribute name="extend" default="SimEntityBase"/> + <xs:attribute name="implement"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Comment" type="xs:string"/> + <xs:element name="Parameter"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="StateVariable"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Event"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Argument"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="LocalVariable"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="StateTransition"/> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element ref="AssemblySchedule"/> + <xs:element ref="Cancel"/> + </xs:choice> + <!-- Regardless of this sequence, code blocks will appear in the correct + place in generated source code --> + <xs:element minOccurs="0" ref="Code"/> + <xs:element minOccurs="0" ref="Coordinate"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:ID"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Code" type="xs:string"/> + <xs:element name="Argument"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="LocalVariable"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + </xs:sequence> + <xs:attribute name="name" use="required" type="xs:NMTOKEN"/> + <xs:attribute name="type" use="required"/> + <xs:attribute name="value"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Operation"> + <xs:complexType> + <xs:attribute name="method" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Assignment"> + <xs:complexType> + <xs:attribute name="value" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="LocalVariableAssignment"> + <xs:complexType> + <xs:attribute name="value"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="LocalVariableInvocation"> + <xs:complexType> + <xs:attribute name="method"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <!-- bug fix 1183 --> + <xs:element name="StateTransition"> + <xs:complexType> + <xs:sequence> + <xs:choice> + <xs:element ref="Assignment"/> + <xs:element ref="Operation"/> + </xs:choice> + <xs:element minOccurs="0" maxOccurs="1" ref="LocalVariableAssignment"/> + <xs:element minOccurs="0" maxOccurs="1" ref="LocalVariableInvocation"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + </xs:sequence> + <xs:attribute name="state" use="required" type="xs:IDREF"/> + <xs:attribute name="index"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="EdgeParameter"> + <xs:complexType> + <xs:attribute name="value" use="required"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> + <xs:element name="Cancel"> + <xs:complexType> + <xs:sequence> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Code"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Comment"/> + <xs:element minOccurs="0" maxOccurs="unbounded" ref="EdgeParameter"/> + </xs:sequence> + <xs:attribute name="event" use="required" type="xs:IDREF"/> + <xs:attribute name="condition"/> + <xs:attribute name="description"/> + </xs:complexType> + </xs:element> +</xs:schema> diff --git a/viskit/configuration/Viskit.ico b/viskit/configuration/Viskit.ico new file mode 100644 index 0000000000000000000000000000000000000000..c9d5908c91e327600695feac75e406ee99fbb30a Binary files /dev/null and b/viskit/configuration/Viskit.ico differ diff --git a/viskit/configuration/ViskitSplash2.png b/viskit/configuration/ViskitSplash2.png new file mode 100644 index 0000000000000000000000000000000000000000..9ce7ad1d46f4f946f9b8b932913a048fe06ed807 Binary files /dev/null and b/viskit/configuration/ViskitSplash2.png differ diff --git a/viskit/configuration/c_app.xml b/viskit/configuration/c_app.xml new file mode 100644 index 0000000000000000000000000000000000000000..bfa3ce358d8ae2ad2bbe0c44974a9f1f5fa6da43 --- /dev/null +++ b/viskit/configuration/c_app.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Viskit application configuration file c_app.xml --> + +<!-- Programming note: values in this file are retrieved by keys such as 'app.beanshell.warning' --> +<!-- Programming note: the root element name is ignored when assembling keys --> +<ViskitConfig> + <app> + <beanshell> + <warning>true</warning> + </beanshell> + <mainframe> + <size h="680" w="930"/> + </mainframe> + <projecthome> + <!-- These two attributes MUST always be at least zero-length Strings --> + <!-- DefaultProject is included in this template for convenience --> + <path dir="../examples/src"/> + <name value="ViskitOpenDis7Examples"/> + </projecthome> + <tabs> + <EventGraphEditor visible="true"/> + <AssemblyEditor visible="true"/> + <AssemblyRun visible="true"/> + <DesignOfExperiments visible="false"/> + <ClusterRun visible="false"/> + <AnalystReport visible="false"/> + </tabs> + <debug>false</debug> + </app> + <history> + <ProjectEditor> + <Recent> + </Recent> + </ProjectEditor> + <EventGraphEditor> + <Recent> + </Recent> + </EventGraphEditor> + <AssemblyEditor> + <Recent> + </Recent> + </AssemblyEditor> + <Cluster> + <Account last="true" server="wipeout.hpr.nps.edu" port="4444" username="" password=""/> + </Cluster> + </history> +</ViskitConfig> diff --git a/viskit/configuration/c_gui.xml b/viskit/configuration/c_gui.xml new file mode 100644 index 0000000000000000000000000000000000000000..b1631937181b261d5356f377740fd252fcd246cd --- /dev/null +++ b/viskit/configuration/c_gui.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- values in this file are retrieved by keys such as 'gui.beanshellerrordialog.title' --> +<!-- the root element name is ignored when assembling keys --> +<ViskitConfig> + <gui> + <beanshellerrordialog> + <title>Warning</title> + <label>Java language error:</label> + <question>Ignore and continue?</question> + <sessioncheckbox>Hide warnings for current session</sessioncheckbox> + <preferencescheckbox>Hide warnings permanently</preferencescheckbox> + <preferencestooltip>A very primitive Java compile warning indicator</preferencestooltip> + </beanshellerrordialog> + <title> + <projecthome> + <generation>Viskit Project Generation Dialog</generation> + </projecthome> + </title> + <tooltip> + <projecthome>Select a location for a Viskit project home</projecthome> + </tooltip> + <button> + <projectgeneration> + <text>Generate Project</text> + <image>PlayGreen16.gif</image> + <tt>Generate your Viskit project</tt> + </projectgeneration> + </button> + <projecttitle> + <name value="ViskitOpenDis7Examples"/> + </projecttitle> + <lookandfeel>platform</lookandfeel> + </gui> +</ViskitConfig> diff --git a/viskit/configuration/viskitProject.xml b/viskit/configuration/viskitProject.xml new file mode 100644 index 0000000000000000000000000000000000000000..91c9a9e3e6ee9ec708e59c9cf3bedc2f97236e45 --- /dev/null +++ b/viskit/configuration/viskitProject.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ViskitProject name="DefaultProject"> + <AnalystReports name="AnalystReports" /> + <AssembliesDirectory name="Assemblies" /> + <EventGraphsDirectory name="EventGraphs" /> + <BuildDirectory name="build"> + <ClassesDirectory name="classes" /> + <SourceDirectory name="src" /> + </BuildDirectory> + <DistDirectory name="dist" /> + <LibDirectory name="lib" /> +</ViskitProject> diff --git a/viskit/doc/NB-Project-Creation.txt b/viskit/doc/NB-Project-Creation.txt new file mode 100644 index 0000000000000000000000000000000000000000..24413e57aa8e84b075c51cbea3cfb5eb033fe6ad --- /dev/null +++ b/viskit/doc/NB-Project-Creation.txt @@ -0,0 +1,47 @@ +22 JAN 2016 + +In order to closely study, without the overhead for how Viskit creates and +runs a project, once a project is produced, it can be easily ported +over to a NetBeans (or standalone) project, both of which can be launched via +Apache Ant. + +1) Move/Copy the ${myViskitProjects/${projectName}/build/src directory up two +levels to the ${projectName} directory. The build/src directory is created by +Viskit before it generates Java source out of all Event Graph XML files in the +project and is continually overwritten during Viskit runtime. + +2) Modify the assembly source code (now located in ${projectName}src/) as +detailed here: + +In the constructor under setNumberReplications(1), paste: + setVerboseReplication(-1); + setPrintReplicationReports(true); + setPrintSummaryReport(true); + setSaveReplicationData(false); + setOutputStream(System.out); + +These are all Viskit Runtime specific and will cause errors to be thrown when +run from a standalone (non-Viskit) context if set otherwise. + +Modify setStopTime(1000); to the desired # of milliseconds of runtime + +3) In the method createDesignPointStats(), comment out +super.createDesignPointStats(). Again, we are not in the Viskit Runtime +environment. We are only using some of Viskit's classpath for standalone +operation. + +4) Copy over Viskit's configuration, Schemas and lib directories (lib/support +can be omitted) into your standalone project directory. It will help to modify +two configuration files found in the /configuration directory, c_app.xml -> +modify the projecthome.path and projecthome.name attributes to be the parent +directory (use full path names) and the project directory name. For c_gui.xml, +modify the projecttitle.name attribute to be the same name as the project.name. +This will ensure seamless viskit.jar use for your standalone project. + +5) Next, create a new NetBeans Java project stating "with source code." Set up +the classpath to point to the project's "lib" directory. The viskit.jar will +also be required in the classpath, but you will not be running Viskit. It is +found in Viskit's build/lib directory. The Assembly source will be your +project's "Main." + +Select "Run" from Netbeans, or type: java -jar YourProjectName.jar into the CLI diff --git a/viskit/doc/ViskitOverview.pdf b/viskit/doc/ViskitOverview.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8d3a084d4959c5adcdd6abe98996dcf8b0f9d837 Binary files /dev/null and b/viskit/doc/ViskitOverview.pdf differ diff --git a/viskit/doc/ViskitSoftwareDesignSummary.txt b/viskit/doc/ViskitSoftwareDesignSummary.txt new file mode 100644 index 0000000000000000000000000000000000000000..2b4474445236ab32c3eac5922ab4967c625459e4 --- /dev/null +++ b/viskit/doc/ViskitSoftwareDesignSummary.txt @@ -0,0 +1,206 @@ +This file will attempt to explain the inner workings of Viskit. + +To build Viskit, from the command line, type "ant compile." This process will +first generate XML binding source files from various Schema files located in the +"Schemas: directory. The generated bindings are generated to specific packages +in the "src" directory of the Viskit build. This is accomplished via JAXB. XML +bindings help to interface java source with the XML representations of +EventGraph and Assembly files. + +Next, the main Viskit source is compiled. Viskit can now be launched by typing +"ant quick.run" on the command line. How to use Viskit is explained in the +JavaHelp tutorial that can be accessed from Viskit once it's launched by +selecting the Help menu, or by launching the help menu via a command line call +to "ant help." + +When Viskit is first launched, it creates a .viskit directory in the +${user.home}. Here, configuration files are placed that can be modified from +Viskit by selecting File -> Settings. Things such as what panels to expose, the +"look and feel" of the UI, size of the UI frame, what project space was last +opened, what files were recently opened, and other project history data are +recorded. Various logging output files are also generated and placed there for +later reference should an error have occurred. All of these can be accessed for +content review by running any of the "ant show.*" targets from the command line. + +After the .viskit directory is populated, Viskit will popup a dialog to either +open an existing Viskit project, create a new one, or exit. A default Viskit +project will be created in ${user.home}/MyViskitProjects/DefaultProject if the +user attempts to open an existing project, but then cancels. If the user wants +to create a new project, the dialog will warn of a project with the same name +and give the user another chance to create a project with a different name. + +A Viskit project consists of a set of directories and a project config. file: + +AnalystReports (main directory for reporting material) + charts (JFreeChart charts showing statistical data) + images (main folder for screenshots of all Assembly and EventGraph views) + Assemblies + EventGraphs + statistics (XML files of Simkit generated statistics) + viskit.ico (favicon for generated HTML reports) + +Assemblies (main folder for Assembly XML files) + +EventGraphs (main folder for EvevtGraph XML files) + +build (generated java source and byte code class files from EventGraph and Assembly XML files) + classes + src + +lib (directory to hold project specific java based libraries) + +viskitProject.xml (project configuration XML file) + +The most important feature of the viskitProject.xml file is the MD5 caching of +successfully validated and compiled EventGraph files. This is to prevent +unnecessary recompilation of project materials once Viskit re-launches and opens +an existing project. The MD5 hashes are recorded under the Cached element of +the viskitProject.xml file. If a successfully cached and opened EG is modified +such that its XML is no longer valid, or doesn't compile, the cached line will +be removed from the project's cache element until the issue is resolved. A new +MD5 hash will then be generated and recorded in the project's cache element. + +MD5 caching is not performed on Assemblies. Assy files are validated and +compiled each time the Assembly runner is launched. + +If a Viskit project has specific dependencies, jar files can be placed in the +"lib" directory of the project and are automatically exposed on the classpath +which can be checked by selecting File -> Settings -> Additional classpath +entries. Other dependencies can be placed on the classpath when not co-located +with an existing Viskit project by selecting those jars via the "+" button which +opens a dialog in the parent project directory in order to navigate to and +select those jars. The project's "lib" is merely a convenience folder for +placing dependency jars. Jar paths are annotated in the extraClassPaths element +of the viskitProject.xml file. + +A chain of further events is initiated so that Viskit can track EventGraph and +Assembly XML file modifications. + +1) A DirectoryWatch is first set on a /tmp location for EG and Assy files. A +listener listens for the opening of, or changes to these files which ensures +that these copies receive any modifications and are checked before saving them +back out to the original file. In a nutshell, working changes are tracked here +until the file is validated, then all changes are copied back to the orig. +files. + +2) The nature of the above /tmp file operation is that once Viskit opens, a +"lock" file is recorded so that next time Viskit opens, the prior /tmp directory +is deleted in order to observe good housekeeping. + +3) Next, the project's EventGraphs directory is parsed for the existence of EG +XML files. These files are first validated against an EG schema, after which +java source is then generated and placed in build/src. The source is then +compiled and the completed byte code is placed in build/classes. Both src and +class directories observe package structures. During the first successful save +of an EG XML file, its MD5 hash is generated a recndorded in the +viskitProject.xml project file along with the path to its generated byte code +(*.class). The build/classes directory is then placed on the live ClassLoader, +the same used to compile these EGs. + +Simultaneously, when an EG is successfully compiled, its icon symbol is placed +on the EG Node pallette of the Assembly Editor panel. This is more commonly +known as the Listener Event Graph Object (LEGO) tree. Accordingly, the current +ClassLoader is parsed for EGs which will also be depicted, i.e. from Simkit, as +well as any EGs in "*.kit" jars placed in the project's /lib directory. This +allows a user to expand nodes, select EG icons (represented in blue color) and +drag to the Assembly canvas to visually construct an Assembly. + +Also simultaneously, any PropertyChangeListeners parsed from the current +ClassLoader will be depicted on the PCL pallette of the LEGO tree under the EG +Lego tree in the same manner as explained above for EGs. The PCL icons are +represented with a pink color. + +SimEntities and PCLs from other libraries, or class file directories can be +placed on the Listener Event Graph Object (LEGO) tree by selecting the "+" +button on the LEGO panel. This will allow a user to drag those representative +SimEntity icons onto the Assy pallette for Assy creation. + + * Of importance for the java source generation of an Assembly is the + * ParameterMap. The ParameterMap is an annotation construct placed in + * generated, or hand-crafted Event Graph source code to depict all described + * parameters of EG constructors which will aid in correct state variable + * initialization when constructing Assemblies. + * + * A zero parameter constructor is always generated in addition to any + * parameterized constructors. + * + * The ParameterMap is also parsed from source code at runtime to allow Viskit + * to properly identify constructors of EGs classes on the classpath whether + * they are from generated source, or contained in third party libraries. The + * importance of this feature is that iconized EGs will be displayed in the + * LEGOs tree panel for drag and drop Assembly construction. + +4) At this time, EG files can be manually opened and modified, or created new. +Due to the unique nature of XML IDs, each method within the same EG file must +have a unique name to pass XML validation. Unique naming can be accomplished +using an underscore character, i.e. Arrival, Arrival_e. The "e" would denote +some method argument name. The names Arrival and Arrival_e would only be used +in the corresponding XML file representation of the EG. The node names will +render correctly without the underscore character. Java will be generated with +normally observed method name overloading conventions. + +If a new empty Viskit project was just created, a new default EG will be opened. +If an EG XML file doesn't validate during a file save, or its corresponding +source code compilation reveals an error, the tab that represents the EG will +change from a green color (signifying valid XML, good source compilation) to red +which signifies an unsaved file, failed XML validation, or failed compilation. +The user will be unable to advance to the Assembly Editor tab until the problem +is corrected. If an EG's source won't compile, any previously compiled byte +code *.class files of the same name will be deleted preventing inclusion on the +classpath. A failed compile will also cause removal of the EG MD5 hash entry +from the project's viskitProject.xml file. If upon start up, a previously +opened XML file passes validation, but fails compilation, the user will again be +unable to advance to the Assy Editor tab. + +Of note is that to ensure all intended entries are made to each node and edge, +be sure to mouse over each and review the tooltip for correct notation. + +5) When an Assembly file is opened, the Design of Experiments (DOE) panel is +initialized with the Assembly and a /tmp DOE input file is created and passed to +the DOE Job Launcher. This file saves the DOE inputs for future use. DOE is an +advanced feature and not necessary for pure vanilla Viskit operation. + +6) All corresponding EGs are opened in the Event Graph Editor panel when an +Assembly file is opened in the Assembly Editor panel. This is accomplished by +parsing SimEntitiy elements of Assy files to know which EGs to open. However, +if any EGs are subclassed from other EGs, these will not open automatically. +Also, if the last remaining Assy file is closed, all open EGs will close +including any non-associated EG files that were also opened. + +7) At this point, the paths of the any opened Assey and EG files are recorded in +the .viskit/c_app.xml file and will be opened upon next Viskit launch. The last +open Viskit project, as well as its history of Assy and EG files will be listed +in the File -> Recents menu selections for each editor. + +8) Opened Assy files can now be modified, or new Assy files can be created. EG +(blue) and PCL (pink) nodes can be dragged across from the LEGOs tree panel, or +menu items can be invoked to do the same. EG nodes are parameterized via dialog +wizards. RandomVariates are instantiated via the RV Factory static getInstance +method utilizing (String, Object...) parameters. Adapters, SimEventListeners +and Property Change Listeners (PCLs) are the last to be selected, connected and +initialized before an Assy run is initiated. + +9) When it is time to run an Assy file, the Initialize assembly runner button is +selected from the Assy Editor which fires off a few events: +- a Directory Watch is set for the Assy file +- validate and compile the Assy +- place compiled source on the classpath +- prepare arguments to launch a separate thread for the Assy +- populate the Assy Run panel with replication selections, reset Sim start time to 0.0 +- switch panel view to the Assy Run panel + +10) When the Simulation Run VCR button is selected, the Assembly is launched via +a Thread who's ClassLoader context is separate (new) from the ClassLoader that +Viskit is currently running. This is to eliminate any in memory static +references to any previously initialized Assembly parameters thereby giving the \ +current Assembly a clean slate to run independently. The main Thread run method +for each XML Assembly file is via subclass of ViskitAssembly which subclasses +BasicAssembly which contains the run method. Subsequent selection of the VCR +run button will produce the exact same results if nothing in the Assy. has been +altered. + +11) The simulation can be immediately stopped via the VCR stop button, or it can +run until its sim. stop time has expired for the number of replications +selected. Step-through and rewind buttons are implemented, but not working +quite right, so, they are disabled upon instantiation from the +InternalAssemblyRunner as of now. diff --git a/viskit/images/ViskitIcon.ico b/viskit/images/ViskitIcon.ico new file mode 100644 index 0000000000000000000000000000000000000000..94879c89b19dd292333b6b1c35e4004cfa0f5d52 Binary files /dev/null and b/viskit/images/ViskitIcon.ico differ diff --git a/viskit/images/ViskitLogo.png b/viskit/images/ViskitLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..98521bc9d9c11a8fb5edaf297ec5033fe5d789b2 Binary files /dev/null and b/viskit/images/ViskitLogo.png differ diff --git a/viskit/lib/actions.jar b/viskit/lib/actions.jar new file mode 100644 index 0000000000000000000000000000000000000000..d9738058e7d157ac721e070e8ba1b69f8ba76492 Binary files /dev/null and b/viskit/lib/actions.jar differ diff --git a/viskit/lib/batik-ext.jar b/viskit/lib/batik-ext.jar new file mode 100644 index 0000000000000000000000000000000000000000..8c904e1f2ab5de46eec36952299a181769e867c1 Binary files /dev/null and b/viskit/lib/batik-ext.jar differ diff --git a/viskit/lib/bsh-2.0b4.jar b/viskit/lib/bsh-2.0b4.jar new file mode 100644 index 0000000000000000000000000000000000000000..ebc78a461ab74735954eb7e3627311dd99cce4ee Binary files /dev/null and b/viskit/lib/bsh-2.0b4.jar differ diff --git a/viskit/lib/commons-beanutils-1.9.4.jar b/viskit/lib/commons-beanutils-1.9.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..b73543cbac7cb62b48dc238329d0f9207c3a7095 Binary files /dev/null and b/viskit/lib/commons-beanutils-1.9.4.jar differ diff --git a/viskit/lib/commons-collections4-4.1.jar b/viskit/lib/commons-collections4-4.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..43a9413b930b0f474efd2817c195ef2a88d7f7b2 Binary files /dev/null and b/viskit/lib/commons-collections4-4.1.jar differ diff --git a/viskit/lib/commons-configuration2-2.10.1.jar b/viskit/lib/commons-configuration2-2.10.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..272b62517aa0c8ed517aa54eb49eb872d3e860b2 Binary files /dev/null and b/viskit/lib/commons-configuration2-2.10.1.jar differ diff --git a/viskit/lib/commons-digester3-3.2.jar b/viskit/lib/commons-digester3-3.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..62e5140a5878246eef72fa8ad42670a59fa5074f Binary files /dev/null and b/viskit/lib/commons-digester3-3.2.jar differ diff --git a/viskit/lib/commons-lang3-3.14.0.jar b/viskit/lib/commons-lang3-3.14.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..da9302ff29a560b5f10d3184f25d699fe2d9c186 Binary files /dev/null and b/viskit/lib/commons-lang3-3.14.0.jar differ diff --git a/viskit/lib/commons-logging-1.3.1.jar b/viskit/lib/commons-logging-1.3.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..0d508f6efbe4045ba5a7df1d5a6e65fda9d56f9f Binary files /dev/null and b/viskit/lib/commons-logging-1.3.1.jar differ diff --git a/viskit/lib/commons-text-1.12.0.jar b/viskit/lib/commons-text-1.12.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..a2daab1488b485bf8b61d0657c96c2a0c59d705c Binary files /dev/null and b/viskit/lib/commons-text-1.12.0.jar differ diff --git a/viskit/lib/jaxb/istack-commons-runtime.jar b/viskit/lib/jaxb/istack-commons-runtime.jar new file mode 100644 index 0000000000000000000000000000000000000000..2fe5b82620b5765e4a77dc3cca97d3424b6cbaed Binary files /dev/null and b/viskit/lib/jaxb/istack-commons-runtime.jar differ diff --git a/viskit/lib/jaxb/javax.activation-api.jar b/viskit/lib/jaxb/javax.activation-api.jar new file mode 100644 index 0000000000000000000000000000000000000000..986c365096a18b43ea6ec9df09f2f52d10902144 Binary files /dev/null and b/viskit/lib/jaxb/javax.activation-api.jar differ diff --git a/viskit/lib/jaxb/jaxb-api.jar b/viskit/lib/jaxb/jaxb-api.jar new file mode 100644 index 0000000000000000000000000000000000000000..45658654712b88d45c9464286ffc2fcb07036bdf Binary files /dev/null and b/viskit/lib/jaxb/jaxb-api.jar differ diff --git a/viskit/lib/jaxb/jaxb-runtime.jar b/viskit/lib/jaxb/jaxb-runtime.jar new file mode 100644 index 0000000000000000000000000000000000000000..0b9ef67c498bd731a34125f540dcc9621adea8d8 Binary files /dev/null and b/viskit/lib/jaxb/jaxb-runtime.jar differ diff --git a/viskit/lib/jcommon.jar b/viskit/lib/jcommon.jar new file mode 100644 index 0000000000000000000000000000000000000000..b46a2b61ecd4050186c1a863b09a8471bee72eb7 Binary files /dev/null and b/viskit/lib/jcommon.jar differ diff --git a/viskit/lib/jdom-1.1.3.jar b/viskit/lib/jdom-1.1.3.jar new file mode 100644 index 0000000000000000000000000000000000000000..a287727868572178c408ef6ffad0a5f27baed34b Binary files /dev/null and b/viskit/lib/jdom-1.1.3.jar differ diff --git a/viskit/lib/jfreechart-1.5.4.jar b/viskit/lib/jfreechart-1.5.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..ddd7c23d1749ba0678f0002fa2b05a96cf99b433 Binary files /dev/null and b/viskit/lib/jfreechart-1.5.4.jar differ diff --git a/viskit/lib/jgraph5.jar b/viskit/lib/jgraph5.jar new file mode 100644 index 0000000000000000000000000000000000000000..f5e91b1831edde2f6af0251bca2f9bf816592a55 Binary files /dev/null and b/viskit/lib/jgraph5.jar differ diff --git a/viskit/lib/jhall.jar b/viskit/lib/jhall.jar new file mode 100644 index 0000000000000000000000000000000000000000..bea4ee09ce1becb3c8c0d524d532e0eafb691a10 Binary files /dev/null and b/viskit/lib/jhall.jar differ diff --git a/viskit/lib/log4j-api-2.23.1.jar b/viskit/lib/log4j-api-2.23.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..0e8e3f5e5928c3dc9d8d8d06e4f7aacfb5090ed4 Binary files /dev/null and b/viskit/lib/log4j-api-2.23.1.jar differ diff --git a/viskit/lib/log4j-core-2.23.1.jar b/viskit/lib/log4j-core-2.23.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..4a5d553d897b9eb341cc0c818d54b07d5c012f7b Binary files /dev/null and b/viskit/lib/log4j-core-2.23.1.jar differ diff --git a/viskit/lib/resolver.jar b/viskit/lib/resolver.jar new file mode 100644 index 0000000000000000000000000000000000000000..e535bdc073355b300614041be473988c3a6c8624 Binary files /dev/null and b/viskit/lib/resolver.jar differ diff --git a/viskit/lib/serializer.jar b/viskit/lib/serializer.jar new file mode 100644 index 0000000000000000000000000000000000000000..de9b007b4c9caf12aa9619e4a5d473ff8b299645 Binary files /dev/null and b/viskit/lib/serializer.jar differ diff --git a/viskit/lib/simkit.jar b/viskit/lib/simkit.jar new file mode 100644 index 0000000000000000000000000000000000000000..d66fd9773c207e6591c89232743a2e4da629d782 Binary files /dev/null and b/viskit/lib/simkit.jar differ diff --git a/viskit/lib/viskit.jar b/viskit/lib/viskit.jar new file mode 100644 index 0000000000000000000000000000000000000000..9a7c4a7574779f8e7e76765f7ace939dab637828 Binary files /dev/null and b/viskit/lib/viskit.jar differ diff --git a/viskit/lib/xalan.jar b/viskit/lib/xalan.jar new file mode 100644 index 0000000000000000000000000000000000000000..458fa73d96e752a0e3ae59b38f7fb9d8a7aed14f Binary files /dev/null and b/viskit/lib/xalan.jar differ diff --git a/viskit/lib/xercesImpl.jar b/viskit/lib/xercesImpl.jar new file mode 100644 index 0000000000000000000000000000000000000000..0aaa990f3ecadf60d28b5395dc87bbe49da0cdd7 Binary files /dev/null and b/viskit/lib/xercesImpl.jar differ diff --git a/viskit/lib/xmlrpc-2.0.jar b/viskit/lib/xmlrpc-2.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..991edc29a25590de80fa91a382bdc7348134bf62 Binary files /dev/null and b/viskit/lib/xmlrpc-2.0.jar differ diff --git a/viskit/license/THIRDPARTYLICENSEREADME.html b/viskit/license/THIRDPARTYLICENSEREADME.html new file mode 100644 index 0000000000000000000000000000000000000000..ed6fad901b62e24a5f2b6494d32ba56fcccf67f0 --- /dev/null +++ b/viskit/license/THIRDPARTYLICENSEREADME.html @@ -0,0 +1,205 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> +<HEAD> + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1"> + <TITLE></TITLE> + <META NAME="GENERATOR" CONTENT="StarOffice 6.0 (Solaris Sparc)"> + <META NAME="AUTHOR" CONTENT=" "> + <META NAME="CREATED" CONTENT="20020520;9402100"> + <META NAME="CHANGED" CONTENT="20030905;14502600"> +</HEAD> +<BODY LANG="en-US"> +<P>A) The following software may be included in this product: ANT, +1.5.4; RegExp; Xerces 2.x; Xindice v1.1; Tomcat v5; Xalan v2.x; +Struts v1.1; BCEL; Apache XML Dsig; Apache xmlenc, XML Security 1_0_6. Use of +any of this software is governed by the terms of the license below: +</P> +<P>Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: Redistribution of source code must retain the above +copyright notice, this list of conditions and the following +disclaimer. Redistribution in binary form must reproduce the above +copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided with +the distribution. All advertising materials mentioning features or +use of this software must display the following acknowledgment: This +product includes software developed by the Java Apache Project for +use in the Apache JServ servlet engine project +(http://java.apache.org/).</P> +<P>The names "Apache JServ", "Apache JServ Servlet +Engine" and "Java Apache Project" must not be used to +endorse or promote products derived from this software without prior +written permission. Products derived from this software may not be +called "Apache JServ" nor may "Apache" nor +"Apache JServ" appear in their names without prior written +permission of the Java Apache Project. Redistribution of any form +whatsoever must retain the following acknowledgment: This product +includes software developed by the Java Apache Project for use in the +Apache JServ servlet engine project (http://java.apache.org/).</P> +<P>THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" +AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE +PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE.</P> +<P>B) The following software may be included in this product: DOM +(Document Object Model). Use of any of this software is governed by +the terms of the license below:</P> +<P>W3C® SOFTWARE NOTICE AND LICENSE</P> +<P>Copyright © 1994-2002 World Wide Web Consortium, +(Massachusetts Institute of Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All +Rights Reserved. http://www.w3.org/Consortium/Legal/</P> +<P>This W3C work (including software, documents, or other related +items) is being provided by the copyright holders under the following +license. By obtaining, using and/or copying this work, you (the +licensee) agree that you have read, understood, and will comply with +the following terms and conditions:</P> +<P>Permission to use, copy, modify, and distribute this software and +its documentation, with or without modification, for any purpose and +without fee or royalty is hereby granted, provided that you include +the following on ALL copies of the software and documentation or +portions thereof, including modifications, that you make:</P> +<P>1.The full text of this NOTICE in a location viewable to users of +the redistributed or derivative work. +</P> +<P>2.Any pre-existing intellectual property disclaimers, notices, or +terms and conditions. If none exist, a short notice of the following +form (hypertext is preferred, text is permitted) should be used +within the body of any redistributed or derivative code: "Copyright +© [$date-of-software] World Wide Web Consortium, (Massachusetts +Institute of Technology, Institut National de Recherche en +Informatique et en Automatique, Keio University). All Rights +Reserved. http://www.w3.org/Consortium/Legal/" +</P> +<P>3.Notice of any changes or modifications to the W3C files, +including the date changes were made. (We recommend you provide URIs +to the location from which the code is derived.) +</P> +<P>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND +COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY +OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE +OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, +COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE +LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.</P> +<P>The name and trademarks of copyright holders may NOT be used in +advertising or publicity pertaining to the software without specific, +written prior permission. Title to copyright in this software and any +associated documentation will at all times remain with copyright +holders.</P> +<P>C) The following software may be included in this product: +iso-relax.jar v2002/07/07; This software may be obtained under the +terms of the license below:</P> +<P>The MIT License</P> +<P>Copyright (c) +</P> +<P>Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation files +(the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions:</P> +<P>The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software.</P> +<P>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE</P> +<P>D) The following software may be included in this product: +relaxngDatatype.jar v1.0; This software may be obtained under the +terms of the license below:</P> +<P>Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun +Microsystems. All rights reserved.</P> +<P>Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met:</P> +<P>Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer.</P> +<P>Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution.</P> +<P>Neither the names of the copyright holders nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission.</P> +<P>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</P> +<P>E) The following software may be included in this product: JLEX; +This software may be obtained under the terms of the license below:</P> +<P>JLEX COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.</P> +<P>Copyright 1996-2003 by Elliot Joel Berk and C. Scott Ananian +</P> +<P>Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and +that both the copyright notice and this permission notice and +warranty disclaimer appear in supporting documentation, and that the +name of the authors or their employers not be used in advertising or +publicity pertaining to distribution of the software without +specific, written prior permission. +</P> +<P>The authors and their employers disclaim all warranties with +regard to this software, including all implied warranties of +merchantability and fitness. In no event shall the authors or their +employers be liable for any special, indirect or consequential +damages or any damages whatsoever resulting from loss of use, data or +profits, whether in an action of contract, negligence or other +tortious action, arising out of or in connection with the use or +performance of this software. +</P> +<P>Java is a trademark of Sun Microsystems, Inc. References to the +Java programming language in relation to JLex are not meant to imply +that Sun endorses this product. +</P> +<P>F) The following software may be included in this product: CUP +Parser Generator; This software may be obtained under the terms of +the license below:</P> +<P>CUP Parser Generator Copyright Notice, License, and Disclaimer</P> +<P>Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott +Ananian +</P> +<P>Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and +that both the copyright notice and this permission notice and +warranty disclaimer appear in supporting documentation, and that the +names of the authors or their employers not be used in advertising or +publicity pertaining to distribution of the software without +specific, written prior permission. +</P> +<P>The authors and their employers disclaim all warranties with +regard to this software, including all implied warranties of +merchantability and fitness. In no event shall the authors or their +employers be liable for any special, indirect or consequential +damages or any damages whatsoever resulting from loss of use, data or +profits, whether in an action of contract, negligence or other +tortious action, arising out of or in connection with the use or +performance of this software. +</P> +<P>G) The following software may be included in this product: CUP +Parser Generator; This software may be obtained under the terms of +the license below:</P> +</BODY> +</HTML> diff --git a/viskit/license/lgpl.txt b/viskit/license/lgpl.txt new file mode 100644 index 0000000000000000000000000000000000000000..cbee875ba6ddb0dadab286daf7ccec2f6f64191f --- /dev/null +++ b/viskit/license/lgpl.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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 with +this License. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/viskit/license/license.html b/viskit/license/license.html new file mode 100644 index 0000000000000000000000000000000000000000..2bc7da9649e2102f7a366a0ab3efd66eac15aeef --- /dev/null +++ b/viskit/license/license.html @@ -0,0 +1,55 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head> + <title>NPS MOVES Software License</title> + <meta name="description" content="NPS MOVES Software License" ></meta> + <meta name="author" content="Donald P. Brutzman" ></meta> + <meta name="created" content="4 March 2005" ></meta> + <meta name="revised" content="24 January 2009" ></meta> + <meta name="reference" content="http://www.oreilly.com/catalog/osfreesoft" ></meta> + <meta name="reference" content="http://opensource.org/licenses/bsd-license.php" ></meta> + <meta name="reference" content="http://xchat.movesinstitute.org/bugzilla/show_bug.cgi?id=32" ></meta> + <link rel="icon" href="http://www.web3D.org/x3d/content/examples/images/X3DtextIcon16.png" title="X3D" type="image/png"></link> + </head> + <body> + <p>Copyright (c) 1995-2024 held by the author(s). All rights reserved.</p> + + <p>Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met:</p> + + <ul> + <li> + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + </li> + <li> + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + </li> + <li> + Neither the names of the + <a href="http://www.nps.edu">Naval Postgraduate School (NPS)</a> + <a href="https://my.nps.edu/web/moves">Modeling, Virtual Environments and Simulation (MOVES) Institute</a> + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + </li> + </ul> + + <p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE.</p> + </body> +</html> diff --git a/viskit/license/license.txt b/viskit/license/license.txt new file mode 100644 index 0000000000000000000000000000000000000000..57852338deae9c006d227a78c31d317fccd5db90 --- /dev/null +++ b/viskit/license/license.txt @@ -0,0 +1,31 @@ +Copyright (c) 1995-2024 held by the author(s). All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the names of the Naval Postgraduate School (NPS) + Modeling, Virtual Environments and Simulation (MOVES) Institute + (http://www.nps.edu and https://my.nps.edu/web/moves) + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE.