📄 antnetworknode.ned
字号:
//-------------------------------
// File: antNetworkNode.ned
// This is a simple simulation program whose purpose is just
// to understand how antNet algorithm works
//-------------------------------
import "antGenerator.ned",
"antNest.ned",
"antSink.ned",
"dataGenerator.ned",
"dataSink.ned",
"genericRouter.ned",
"genericNetworkNode.ned";
//
// Building block of the antNet algorithm. The interface of this
// module conforms to the interface of genericNetworkNode and hence
// in this way we could implement different routing algorithms.
// We could say that OSPFNetworkNode will implement OSPF....
//
module antNetworkNode
parameters:
address : numeric const,
numStations : numeric const,
nGates : numeric const,
dataRate : numeric const,
log : bool,
sFile : string;
gates:
in: in[];
out: out[];
submodules:
dGen: dataGenerator;
parameters:
address = address,
numStations = numStations,
logResults = log,
iaTime = input,
numMessages = input,
messageLength = input,
sleepTimeAtStart = input,
statFile = sFile;
display: "o=#008000;p=203,48;b=36,30";
aGen: antGenerator;
parameters:
address = address,
numStations = numStations,
logResults = log,
iaTime = input,
messageLength = input,
sleepTimeAtStart = input,
statFile = sFile;
display: "o=#ff8000;p=120,56;b=36,16";
dSink: dataSink;
parameters:
sleepTimeAtStart = input,
logResults = log,
throughputInterval = input,
statFile = sFile;
display: "o=#008000;p=259,48;b=36,30";
aSink: antSink;
parameters:
logResults = log,
sleepTimeAtStart = input,
statFile = sFile;
display: "o=#ff8000;p=68,56;b=36,16";
router: Router;
parameters:
address = address,
numStations = numStations,
dataRate = dataRate,
logResults = log,
messageLength = input,
queueSize = input,
probabilisticRouting = input,
statFile = sFile;
gatesizes:
in[nGates],
out[nGates];
display: "p=233,150;i=xconn;b=40,24";
aNest: antNest;
parameters:
logResults = log,
expMeanCoefficient = input,
windowSizeCoefficient = input,
zetaConfidenceLevel = input,
explorationProbablity = input,
rescalingPower = input,
queueWeight = input,
forkProbability = input,
maxHopsCoefficient = input,
ageLimit = input,
squashFunctionCoefficient = input,
probabilisticRouting = input,
statFile = sFile;
display: "o=#ff8000;p=102,152;b=35,25";
connections:
dGen.toAntGen --> aGen.fromDataGen;
dGen.toRouter --> router.fromDataGen;
aGen.toAntNest --> aNest.fromAntGen;
aGen.toRouter --> router.fromAntGen;
aNest.toAntSink --> aSink.fromAntNest;
aNest.toRouter --> router.fromAntNest;
router.toAntNest --> aNest.fromRouter;
router.toDataSink --> dSink.fromRouter;
// connecting all input ports of the router node to the
// input ports of the networknode and vice versa
for i=0..nGates-1 do
in[i] --> router.in[i];
out[i] <-- router.out[i];
endfor;
display: "p=8,10;b=298,186";
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -