Python: only call ns3::Simulator::RunOne if we're running the default event scheduler; partially fixes Bug 631.

This commit is contained in:
Gustavo J. A. M. Carneiro
2010-08-10 12:16:10 +01:00
parent 01d61618d3
commit 775ff127a4

View File

@@ -285,7 +285,15 @@ _wrap_Simulator_Run(PyNs3Simulator *PYBINDGEN_UNUSED(dummy), PyObject *args, PyO
PyObject **return_exception)
{
const char *keywords[] = {"signal_check_frequency", NULL};
int signal_check_frequency = 100;
int signal_check_frequency;
ns3::Ptr<ns3::DefaultSimulatorImpl> defaultSim =
ns3::DynamicCast<ns3::DefaultSimulatorImpl> (ns3::Simulator::GetImplementation ());
if (defaultSim) {
signal_check_frequency = 100;
} else {
signal_check_frequency = -1;
}
if (!PyArg_ParseTupleAndKeywords(args, kwargs, (char *) "|i", (char **) keywords, &signal_check_frequency)) {
PyObject *exc_type, *traceback;