git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ns-3 simulator synchronizing start
[nepi.git]
/
src
/
nepi
/
resources
/
ns3
/
ns3wrapper.py
diff --git
a/src/nepi/resources/ns3/ns3wrapper.py
b/src/nepi/resources/ns3/ns3wrapper.py
index
b617f33
..
f6075b0
100644
(file)
--- a/
src/nepi/resources/ns3/ns3wrapper.py
+++ b/
src/nepi/resources/ns3/ns3wrapper.py
@@
-212,6
+212,8
@@
class NS3Wrapper(object):
return uuid
def invoke(self, uuid, operation, *args, **kwargs):
return uuid
def invoke(self, uuid, operation, *args, **kwargs):
+ if operation == "isRunning":
+ return self._is_running()
if operation == "isAppRunning":
return self._is_app_running(uuid)
if operation == "addStaticRoute":
if operation == "isAppRunning":
return self._is_app_running(uuid)
if operation == "addStaticRoute":
@@
-447,6
+449,16
@@
class NS3Wrapper(object):
return realkwargs
return realkwargs
+ def _is_running(self):
+ if self.ns3.Simulator.IsFinished():
+ return False
+
+ now = self.ns3.Simulator.Now()
+ if now.IsZero():
+ return False
+
+ return True
+
def _is_app_running(self, uuid):
now = self.ns3.Simulator.Now()
if now.IsZero():
def _is_app_running(self, uuid):
now = self.ns3.Simulator.Now()
if now.IsZero():