Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/matsim-plugin' into jDEECo-3
Browse files Browse the repository at this point in the history
  • Loading branch information
vladamatena committed Apr 16, 2015
2 parents 1d7a843 + f777fd9 commit 5ef9eb8
Show file tree
Hide file tree
Showing 47 changed files with 10,962 additions and 24 deletions.
13 changes: 2 additions & 11 deletions jdeeco-core/src/cz/cuni/mff/d3s/deeco/network/AbstractHost.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,19 @@

import cz.cuni.mff.d3s.deeco.timer.CurrentTimeProvider;

@SuppressWarnings("rawtypes")
public abstract class AbstractHost implements CurrentTimeProvider {

protected final String id;
protected final CurrentTimeProvider timeProvider;

protected AbstractHost(String id, CurrentTimeProvider timeProvider) {
this.id = id;
this.timeProvider = timeProvider;
}

public String getHostId() {
return id;
}

public abstract DataSender getDataSender();

public abstract void addDataReceiver(DataReceiver dataReceiver);


public long getCurrentMilliseconds() {
return timeProvider.getCurrentMilliseconds();
}
Expand Down Expand Up @@ -50,6 +43,4 @@ public boolean equals(Object obj) {
return false;
return true;
}


}
13 changes: 0 additions & 13 deletions jdeeco-core/src/cz/cuni/mff/d3s/deeco/network/Host.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @author Michal Kit <kit@d3s.mff.cuni.cz>
*
*/
@SuppressWarnings("rawtypes")
public class Host extends AbstractHost implements NetworkInterface {

private final PacketReceiver packetReceiver;
Expand All @@ -28,19 +27,7 @@ protected Host(NetworkProvider networkProvider, CurrentTimeProvider timeProvider
public Host(NetworkProvider networkProvider, CurrentTimeProvider timeProvider, String jDEECoAppModuleId) {
this(networkProvider, timeProvider, jDEECoAppModuleId, true, true);
}
/* (non-Javadoc)
* @see cz.cuni.mff.d3s.deeco.network.HostDataHandler#getDataSender()
*/
@Override
public DataSender getDataSender() {
return packetSender;
}

@Override
public void addDataReceiver(DataReceiver dataReceiver) {
packetReceiver.addDataReceiver(dataReceiver);
}

// Method used by the simulation
public void packetReceived(byte[] packet, double rssi) {
packetReceiver.packetReceived(packet, rssi);
Expand Down
4 changes: 4 additions & 0 deletions jdeeco-matsim-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target/
/.classpath
/logs/
/matsim/
23 changes: 23 additions & 0 deletions jdeeco-matsim-plugin/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cz.cuni.mff.d3s.jdeeco.matsim</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
42 changes: 42 additions & 0 deletions jdeeco-matsim-plugin/input/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE config SYSTEM "./dtd/config_v1.dtd">

<config>

<module name="network">
<param name="inputNetworkFile" value="input/grid.xml" />
</module>

<module name="controler">
<param name="writeEventsInterval" value="1000" />
<param name="writePlansInterval" value="1000" />
<param name="eventsFileFormat" value="xml" />
<param name="outputDirectory" value="matsim"/>
<param name="firstIteration" value="0" />
<param name="lastIteration" value="0" />
<param name="mobsim" value="qsim" />
</module>

<module name="qsim" >
<param name="startTime" value="00:00:00" />
<!-- NOTE: End time will be most probably overrided by the value specified in the jdeeco simulation runner -->
<param name="endTime" value="00:10:00" />
<param name="flowCapacityFactor" value="1.00" />
<param name="storageCapacityFactor" value="1.00" />
<param name="numberOfThreads" value="1" />
<param name = "snapshotperiod" value = "00:00:01"/>
<param name = "simStarttimeInterpretation" value = "onlyUseStarttime"/>

<!-- Boolean. `true': stuck vehicles are removed, aborting the plan; `false': stuck vehicles are forced into the next link. `false' is probably the better choice. -->
<param name="removeStuckVehicles" value="false" />

<!-- time in seconds. Time after which the frontmost vehicle on a link is called `stuck' if it does not move. -->
<param name="stuckTime" value="3600.0" />
<param name="timeStepSize" value="00:00:0.2" />

<!-- `queue' for the standard queue model, `withHolesExperimental' (experimental!!) for the queue model with holes -->
<param name="trafficDynamics" value="queue" />

</module>

</config>
Loading

0 comments on commit 5ef9eb8

Please sign in to comment.