Example #1
0
        public Network(int x, int y, int _base, int buffer, int genLimit, float maxLoadRatio, bool djekstra)
        {
            this.xDim = x;
            this.yDim = y;

            this.msgList = new MessageList();
            this.vertexList = new VertexList(x * y);
            this.edgeList = new EdgeList((x-1)*y + (y-1)*x);

            if ( djekstra )
            {
                this.vrtConfig = new VertexConfig( buffer, _base,genLimit, maxLoadRatio, this.findRouteD );

                this.initVertexList();

                this.initEdgeList();

                //	initializing the incidency matrix variable with dimensions edges x vertices
                this.incidencyMatrix = new AsociatedMatrix<sbyte>( this.vertexList.TheList, this.edgeList.TheList );
            }
            else
            {
                this.vrtConfig = new VertexConfig( buffer, _base,genLimit, maxLoadRatio, this.findRouteC );

                this.initVrtListCoord( x, y );

                this.initEdgeListCoord();
            }
        }
Example #2
0
        public Network(NetworkConfig netcfg, VertexConfig vrtcfg/*, bool djekstra*/)
        {
            this.netConf = netcfg;

            int x = netConf.HNodes;
            int y = netConf.VNodes;

            this.msgList = new MessageList();
            this.vertexList = new VertexList(x * y);
            this.edgeList = new EdgeList((x-1)*y + (y-1)*x);

            // if !djekstra

            vrtcfg.RouteFunc = this.findRouteC;
            this.vrtConfig = vrtcfg;
            this.initVrtListCoord(x, y);
            this.initEdgeListCoord();
        }
Example #3
0
        //    constructor
        public Network( int x, int y )
        {
            this.XDim = x;
            this.YDim = y;

            this.vertexList = new VertexList();
            this.initVertexList();

            this.edgeList = new EdgeList();
            this.initEdgeList();

            int edgeCount = (this.xDim - 1) * this.yDim + (this.yDim - 1) * this.xDim;
            int vertCount = this.xDim * this.yDim;

            //	initializing the incidency matrix variable with dimensions edges x vertices
            this.incidencyMatrix = new AsociatedMatrix<sbyte>( this.vertexList.TheList, this.edgeList.TheList );
        }