package modules.node;

import utils.*;
import simulator.*;
import modules.gradient.*;
import java.util.*;

public class RNodeCountEstimator implements ProcessorLoadEstimator {
  public double estimate(PortedProcessor pp) {
    // get the PN and AG modules
    RamboNode rn = (RamboNode)pp.getModule("RamboNode");
    //PersistentNode pn = (PersistentNode)pp.getModule("PersistentNode");
    ActiveGradient ag = (ActiveGradient)pp.getModule("ActiveGradient");
    // count number of PersistentNodes that processor is participating in
    // and add to number of PN gradients that it touches
    return (rn.getNodes().size() + ag.getType(rn.rambo).size())/2.0;
  }
}
