+#if SIMGRID_HAVE_NS3_GetNextEventTime
+/* If patched, ns3 is idempotent and nice to use */
+bool NetworkNS3Model::next_occurring_event_is_idempotent()
+{
+ return true;
+}
+
+double NetworkNS3Model::next_occurring_event(double sg_time)
+{
+ if (get_started_action_set()->empty()) {
+ return -1.0;
+ }
+
+ double ns3_time = ns3::Simulator::GetNextEventTime().GetSeconds();
+ XBT_DEBUG("NS3 tells that the next occuring event is at %f (it's %f in simgrid), so NS3 returns a delta of %f.",
+ ns3_time, sg_time, ns3_time - sg_time);
+ return ns3_time - sg_time;
+}
+#else
+/* NS3 is only idempotent with the appropriate patch */
+bool NetworkNS3Model::next_occurring_event_is_idempotent()
+{
+ return false;
+}
+