Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix doxygen comments.
[simgrid.git] / src / surf / network_constant.cpp
index af81e49..d9f36dd 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2013-2014. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include "network_constant.hpp"
 #include "surf/random_mgr.h"
 
@@ -30,7 +36,7 @@ double NetworkConstantModel::shareResources(double /*now*/)
   ActionListPtr actionSet = getRunningActionSet();
   for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
         ; it != itend ; ++it) {
-       action = dynamic_cast<NetworkConstantActionPtr>(&*it);
+       action = static_cast<NetworkConstantActionPtr>(&*it);
     if (action->m_latency > 0) {
       if (min < 0)
         min = action->m_latency;
@@ -49,7 +55,7 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
   for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
      ; it != itend ; it=itNext) {
     ++itNext;
-       action = dynamic_cast<NetworkConstantActionPtr>(&*it);
+       action = static_cast<NetworkConstantActionPtr>(&*it);
     if (action->m_latency > 0) {
       if (action->m_latency > delta) {
         double_update(&(action->m_latency), delta);
@@ -61,7 +67,7 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
     if (action->getMaxDuration() != NO_MAX_DURATION)
       action->updateMaxDuration(delta);
 
-    if (action->getRemains() <= 0) {
+    if (action->getRemainsNoUpdate() <= 0) {
       action->finish();
       action->setState(SURF_ACTION_DONE);
     } else if ((action->getMaxDuration() != NO_MAX_DURATION)
@@ -75,8 +81,8 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta)
 ActionPtr NetworkConstantModel::communicate(RoutingEdgePtr src, RoutingEdgePtr dst,
                                         double size, double rate)
 {
-  char *src_name = src->p_name;
-  char *dst_name = dst->p_name;
+  char *src_name = src->getName();
+  char *dst_name = dst->getName();
 
   XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
   NetworkConstantActionPtr action = new NetworkConstantAction(this, size, sg_latency_factor);