package modules.dataflow;

import utils.*;
import simulator.*;
import java.util.*;
import modules.codegas.*;
import modules.gradient.*;
import modules.line.*;
import modules.node.*;
import java.awt.*;

public class DFNVariable extends DFNode {
  Symbol v;

  public DFNVariable(double id, Symbol name, DFNPort io)
  { super(id,io); v=name; }

  Hashtable execute(Object callID,ActiveGradient ag) {
    //System.out.println("GOGOGO!!");
    Iterator i=getPorts();
    if(i.hasNext()) {
      Vector v = getPortValues(ag,callID,(DFNPort)i.next());
      if(!v.isEmpty())
        return sendToAll(ag,callID,v.firstElement());
    }
    return new Hashtable();
  }
}
