Commit f5747ca5 authored by MalkContent's avatar MalkContent

removed TODOs

parent fa973dc4
......@@ -22,7 +22,7 @@ public class FunnelNet {
//public static final int dataWidth = 64/8; //dataWidth in number of segments per transmission. this should be a round number even if it wasn't forced by type.
private final int minBufferSize = packetCycleLatency *2 + 1; //todo: check that it's not actually "packetLatency*2 + 1" edit: yea, this should be packetlatency*2. not even certain it needs +1
private final int minBufferSize = packetCycleLatency *2 + 1;
public final int bufferSize = minBufferSize*2; //max # of packets per buffer
//public static final int bufferSize = 4 + minBufferSize; //max # of packets per buffer
//public static final int bufferSize = 2*minBufferSize; //max # of packets per buffer
......@@ -51,6 +51,7 @@ public class FunnelNet {
public HashSet<DataPacket> livePackets = new HashSet<DataPacket>();
public HashSet<DataPacket> droppedPackets = new HashSet<DataPacket>();
public HashSet<DataPacket> rejectedPackets = new HashSet<DataPacket>();
public final boolean keepSuccessfulPackets = false; //warning: keeping successful packets costs increasingly more ram
public HashSet<DataPacket> successfulPackets = new HashSet<DataPacket>();
public int successfulPacketCounter = 0;
......@@ -128,7 +129,7 @@ public class FunnelNet {
}
curNode.setSubNeighbors(newNetNodes);
}
return nextLayerNodes;// = new HashSet<Node>(); TODO: remove comment when stuff's working
return nextLayerNodes;
}
private ArrayList<Node> createSlaveLayer(int numNewNodes, int layerNumber, ArrayList<Node> prevLayerNodes) {
......
......@@ -26,7 +26,7 @@ public class MasterNode extends Node {
//select receive element
if (superIncoming != null)
System.out.println("WHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT");
superIncoming = selectFromFrontRow(); //uses the superIncoming variable because downwardCom refers to it. /should/ run smoothly. TODO: make sure this actually does run smoothly
superIncoming = selectFromFrontRow(); //uses the superIncoming variable because downwardCom refers to it.
if (idleTicks < 0 && superIncoming != null)
idleTicks = 0;
if (idleTicks >= 0 && superIncoming == null) {
......
......@@ -240,9 +240,7 @@ public abstract class Node {
private int getLocalOrigin(int globalOrigin) {
int divider = (int)Math.pow(parentNet.getNumDownConnections(), parentNet.getNumLayers() - layerNumber - 2);
//int reduced = globalOrigin % (divider*parentNet.getNumDownConnections());
return (globalOrigin % (divider*parentNet.getNumDownConnections())) / divider;
//return globalOrigin / (int)Math.pow(parentNet.getNumDownConnections(), parentNet.getNumLayers() - layerNumber - 2); //TODO: make sure the power is correct
}
public void send(DataPacket message, Node target) {
......
......@@ -64,7 +64,8 @@ public class SlaveNode extends Node {
parentNet.cumulativeRejectRT += age;
}
else if (superIncoming.getMState() == DataPacket.messageState.PROCESSED) {
//parentNet.successfulPackets.add(superIncoming); //todo: readd. this takes up a lot of ram tho
if (this.parentNet.keepSuccessfulPackets)
parentNet.successfulPackets.add(superIncoming); //warning: keeping successful packets costs increasingly more ram
parentNet.successfulPacketCounter++;
if (age < parentNet.minRT)
parentNet.minRT = age;
......
......@@ -38,7 +38,7 @@ public class GlobalTimeStamp extends Strategy {
@Override
protected boolean shouldReject(DataPacket packet) {
//TODO: implement a predictive rejection (reject if it can't make the trip, based on optimal layer latency
//this only rejects already timed out packets
if (parentNode.parentNet.getCycleCounter() - packet.getTimeStamp() > parentNode.parentNet.rtcCycles) {
packet.setMState(dropPackets ? DataPacket.messageState.DROP : DataPacket.messageState.REJECTED);
return true;
......
......@@ -46,7 +46,7 @@ public class GlobalTimeStampLARRR extends Strategy {
FunnelNet net = parentNode.parentNet;
int age = net.getCycleCounter() - packet.getTimeStamp();
int bestCaseUpward = parentNode.getLayerNumber();
int worstCaseDownward = ((net.getNumLayers()-1)*(2+net.bufferSize)); //todo: make sure that this actually is the worst case;
int worstCaseDownward = ((net.getNumLayers()-1)*(2+net.bufferSize)); //should be the worst case. 1 cycle waiting on buffer-stop, 1 cycle + a whole buffer full waiting on downward forwarding
if (age + bestCaseUpward + worstCaseDownward > parentNode.parentNet.rtcCycles) {
packet.setMState(dropPackets ? DataPacket.messageState.DROP : DataPacket.messageState.REJECTED);
return true;
......
......@@ -42,7 +42,7 @@ public class GlobalTimeStampRR extends Strategy {
@Override
protected boolean shouldReject(DataPacket packet) {
//TODO: implement a predictive rejection (reject if it can't make the trip, based on optimal layer latency
//this only rejects already timed out packets
if (parentNode.parentNet.getCycleCounter() - packet.getTimeStamp() > parentNode.parentNet.rtcCycles) {
packet.setMState(dropPackets ? DataPacket.messageState.DROP : DataPacket.messageState.REJECTED);
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment