-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/plugin-architecture' into
omnet-plugin Conflicts: jdeeco-core/src/cz/cuni/mff/d3s/deeco/task/EnsembleTask.java jdeeco-simulation/src/cz/cuni/mff/d3s/deeco/simulation/task/TimerTask.java
- Loading branch information
Showing
45 changed files
with
1,506 additions
and
1,355 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
jdeeco-core/src/cz/cuni/mff/d3s/deeco/network/AbstractHost.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
jdeeco-core/src/cz/cuni/mff/d3s/deeco/runners/DEECoRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package cz.cuni.mff.d3s.deeco.runners; | ||
|
||
import cz.cuni.mff.d3s.deeco.runtime.DEECoNode; | ||
import cz.cuni.mff.d3s.deeco.timer.RunnerTimer; | ||
|
||
/** | ||
* Main entry for running DEECo in "real" deployment. | ||
* For simulation purposes use {@link DEECoSimulation} instead. | ||
* | ||
* @author Ilias Gerostathopoulos <iliasg@d3s.mff.cuni.cz> | ||
*/ | ||
public class DEECoRunner { | ||
|
||
DEECoNode deecoNode; | ||
RunnerTimer runnerTimer; | ||
|
||
public DEECoRunner(RunnerTimer runnerTimer, DEECoNode deecoNode) { | ||
this.runnerTimer = runnerTimer; | ||
this.deecoNode = deecoNode; | ||
} | ||
|
||
public void start() { | ||
runnerTimer.start(); | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
jdeeco-core/src/cz/cuni/mff/d3s/deeco/runners/DEECoSimulation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package cz.cuni.mff.d3s.deeco.runners; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import cz.cuni.mff.d3s.deeco.runtime.DEECoException; | ||
import cz.cuni.mff.d3s.deeco.runtime.DEECoNode; | ||
import cz.cuni.mff.d3s.deeco.runtime.DEECoPlugin; | ||
import cz.cuni.mff.d3s.deeco.timer.SimulationTimer; | ||
|
||
/** | ||
* Main entry for launching DEECo simulations. | ||
* | ||
* @author Ilias Gerostathopoulos <iliasg@d3s.mff.cuni.cz> | ||
*/ | ||
public class DEECoSimulation { | ||
|
||
List<DEECoNode> deecoNodes; | ||
DEECoPlugin[] nodeWideplugins; | ||
SimulationTimer simulationTimer; | ||
|
||
public DEECoSimulation(SimulationTimer simulationTimer, DEECoPlugin... nodeWideplugins) { | ||
this.nodeWideplugins = nodeWideplugins; | ||
this.simulationTimer = simulationTimer; | ||
deecoNodes = new ArrayList<>(); | ||
} | ||
|
||
public void start(long duration) { | ||
simulationTimer.start(duration); | ||
} | ||
|
||
public DEECoNode createNode(DEECoPlugin... nodeSpecificPlugins) throws DEECoException { | ||
DEECoNode node = new DEECoNode(simulationTimer, getAllPlugins(nodeWideplugins, nodeSpecificPlugins)); | ||
deecoNodes.add(node); | ||
return node; | ||
} | ||
|
||
/** | ||
* Helper method that concatenates the array of node-wide plugins with node-specific plugins. | ||
* The returned array is intended to be passed to the DEECoNode() constructor. | ||
* @param nodeSpecificPlugins extra plugins, not provided by the factory | ||
*/ | ||
private DEECoPlugin[] getAllPlugins(DEECoPlugin[] nodeWideplugins, DEECoPlugin[] nodeSpecificPlugins) { | ||
DEECoPlugin[] ret = new DEECoPlugin[nodeSpecificPlugins.length+nodeWideplugins.length]; | ||
int ind=0; | ||
for (int i=0; i<nodeSpecificPlugins.length; i++) { | ||
ret[ind] = nodeSpecificPlugins[i]; | ||
ind++; | ||
} | ||
for (int j=0; j<nodeWideplugins.length; j++) { | ||
ret[ind] = nodeSpecificPlugins[j]; | ||
ind++; | ||
} | ||
return ret; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.