public class Node { private String id; private int est; private int lst; private int duration;
public Node(String id, int duration) { this.id = id; this.duration = duration; }
public void setId(String id) { this.id = id; }
public String getId() { return id; }
public void setEst(int est) { this.est = est; }
public int getEst() { return est; }
public void setLst(int lst) { this.lst = lst; }
public int getLst() { return lst; }
public void setDuration(int duration) { this.duration = duration; }
public int getDuration() { return duration; } }
public class Edge { private Node from; private Node to; private int weight;
public Edge(Node from, Node to, int weight) { this.from = from; this.to = to; this.weight = weight; }
public int calculateEst() { return from.getEst() + weight; }
public int calculateLst() { return to.getLst() - weight; }
public Node getFrom() { return from; }
public Node getTo() { return to; }
public int getWeight() { return weight; } }
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
public class PERTChart {
private List
public PERTChart() {
nodes = new ArrayList
public void addNode(Node node) { nodes.add(node);
上一篇:algorithm-node-tree-typescript
下一篇:Algorithmformacaddressassignmentwithenc28j60(使用enc28j60进行MAC地址分配的算法)