simu = ec.register_resource("LinuxNS3Simulation")
ec.set(simu, "verbose", True)
ec.set(simu, "enableDump", True)
-ec.set (simu, "StopTime", "22s")
+ec.set (simu, "stopTime", "22s")
ec.register_connection(simu, node)
x = 30
type = Types.Bool,
flags = Flags.Design)
+ stoptime = Attribute("stopTime",
+ "Time at which the simulation will stop",
+ flags = Flags.Design)
+
cls._register_attribute(impl_type)
cls._register_attribute(sched_type)
cls._register_attribute(check_sum)
cls._register_attribute(ns3_version)
cls._register_attribute(pybindgen_version)
cls._register_attribute(populate_routing_tables)
+ cls._register_attribute(stoptime)
def __init__(self, ec, guid):
LinuxApplication.__init__(self, ec, guid)
self._client.start()
- """
- # XXX: IS THIS REALLY NEEDED??
+ # XXX: IS THIS REALLY NEEDED??!!!
# Wait until the Simulation is actually started...
-
is_running = False
for i in xrange(1000):
is_running = self.invoke(SIMULATOR_UUID, "isRunning")
msg = " Simulation did not start"
self.error(msg)
raise RuntimeError
- """
self.set_started()
else:
"""
if self.state == ResourceState.STARTED:
- self._client.stop()
+ time = None
+ if self.get("stopTime"):
+ time = self.get("stopTime")
+
+ self._client.stop(time=time)
self.set_stopped()
def do_release(self):