@Override protected void reset() { super.reset(); if (node_data == null) return; for (NodeData node : node_data.values()) node.reset(); }
@Override protected void update() throws BeatsException { if (node_data == null) return; for (NodeData nd : node_data.values()) { nd.update(myScenario.get.clock()); nd.deploy(myScenario.get.currentTimeInSeconds()); } }
@Override protected void populate(Object jaxbO) { edu.berkeley.path.beats.jaxb.Controller jaxbC = (edu.berkeley.path.beats.jaxb.Controller) jaxbO; node_data = new HashMap<Long, NodeData>(); for (Row row : jaxbController.getTable().get(0).getRow()) { Link link = null; String demandString = ""; double dpdt = Double.NaN; double knob = Double.NaN; for (Column col : row.getColumn()) { switch ((int) col.getId()) { case 0: link = getMyScenario().get.linkWithId(Integer.parseInt(col.getContent())); break; case 1: demandString = col.getContent(); break; case 2: dpdt = Double.parseDouble(col.getContent()); break; case 3: knob = Double.parseDouble(col.getContent()); break; } } if (!demandString.isEmpty() && link != null && !Double.isNaN(knob) && !Double.isNaN(dpdt)) node_data.put(link.getId(), new NodeData(this, link, demandString, knob, dpdt, myScenario)); } }
@Override protected void validate() { super.validate(); for (NodeData node : node_data.values()) node.validate(); }
@Override public boolean register() { for (NodeData nd : node_data.values()) if (!nd.cms.register()) return false; return true; }
public void set_knob_for_link(Long link_id, double newknob) { node_data.get(link_id).set_knob(newknob); }