⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 antnetworknode.ned

📁 In this implementation of AntNet-3.0 one could get the behavior of both algorithms through a simple
💻 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";
	   
	   
// antNetworkNode --
//
// 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,
		statPath : string;
	
	gates:
		in: in[];
		out: out[];


	submodules:

		dGen: dataGenerator;
			parameters:
				address = address,
				numStations = numStations,
				logResults = log,
				iaTime = input,
				numMessages = input,
				messageLength = input,
				sleepTimeAtStart = input,
				startTime = input,
				endTime = input,
				hotSpot = input,
				hotmpia = input,
				statModulePath = statPath;

		aGen: antGenerator;
			parameters:
				address = address,
				numStations = numStations,
				logResults = log,
				iaTime = input,
				messageLength = input,
				sleepTimeAtStart = input,
				converganceTime = input,
				statModulePath = statPath;

		
		dSink: dataSink;
			parameters:
				sleepTimeAtStart = input,
				logResults = log,
				throughputInterval = input,
				statModulePath = statPath;
				
		
		aSink: antSink;
			parameters:
				logResults = log,
				sleepTimeAtStart = input,
				statModulePath = statPath;

		
		router: Router;
			parameters:
				address = address,
				numStations = numStations,
				dataRate = dataRate,
				logResults = log,
				messageLength = input,
				queueSize = input,
				probabilisticRouting = input,
				startTime = input,
				endTime = input,
				qWeightFactor = input,
				statModulePath = statPath;
			
			gatesizes:
				in[nGates],
				out[nGates];

		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,
				statModulePath = statPath;
	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;

endmodule	



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -