Skip to content
Snippets Groups Projects
Commit 98b513b1 authored by Terry D. Norbraten's avatar Terry D. Norbraten
Browse files

[Terry N.] DIS demo proj. moved to assignments space

parent 8f571707
No related branches found
No related tags found
No related merge requests found
<?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=""/>
<Output entity="aPOpenDis7"/>
<Schedule stopTime="100.0" verbose="false" saveReplicationData="false"/>
</SimkitAssembly>
<?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=""/>
<Output entity="arrivalProcessOpenDis7"/>
<Output entity="simpleServer"/>
<Schedule stopTime="100000.0" verbose="false" saveReplicationData="false"/>
</SimkitAssembly>
<?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>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SimEntity name="SimpleServer" package="dis7" 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 &gt; 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 &gt; 0" priority="HIGH"/>
<Coordinate x="330.0" y="130.0"/>
</Event>
</SimEntity>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment