No BSD License  

Highlights from
MatPlanWDM v0.5

image thumbnail

MatPlanWDM v0.5



29 Jan 2007 (Updated )

Educational network planning tool for the RWA problem in WDM networks (MILP and heuristic based)

% IO_readTraffString
% Usage: [traff_trafficMatrix, errmsg ,errorFlag] = IO_readTraffString(traffString)
% Abstract: This function reads a traffic string, that is, a string of
% characters equal to a string of a  Traffic File (*.traff). A Traffic File
% (*.traff) contains the  Traffic Matrix, that is, the table of the
% traffic demands for all the possible node pairs. 
% In the whole file the columns (fields) are separated by TABS and the rows
% by RETURNS. Each field column is represented  according to C language
% FORMAT. The FORMAT is a string containing C language conversion specifications. 
%A conversion specification controls the notation, alignment, significant digits, 
%field width, and other aspects of output format. The format string can 
%contain escape characters to represent nonprinting characters such as 
%newline characters and tabs. Conversion specifications begin with 
%the % character and contain these optional and required elements: 
% Flags (optional) 
% Width and precision fields (optional) 
% A subtype specifier (optional) 
% .Conversion character (required) 
% Arguments:
% o	In: 
% 	traffString: String with all the characters to be written in a Traffic
%   File (*.traff)
% o	Out: 
%  traff_trafficMatrix(NxN): Average traffic flow offered between node pairs. The 
%  Traffic Matrix is a two-dimensional matrix with N (N: number of nodes) rows 
%  and N columns. An entry(s,d) means the average traffic flow from node 's' 
%  to node 'd', measured as the number of bits per second. 
% . errmsg: Error message. If the string is valid (errorFlag = 0),
%   errmsg='No Error'; otherwise, errmsg indicates the error in the string. 
% . errorFlag: If the phys string is valid, errorFlag = 0; otherwise
%   errorFlag = -1.
%                                       Ramon Aparicio Pardo,2007

function [traff_trafficMatrix, errmsg, errorFlag] = IO_readTraffString(traffString)

if (nargin==0),  help IO_readTraffString;return, end %help calling
if (nargin~=1),  error('??? Error using ==> IO_readTraffString. Incorrect number of arguments.'),end %Number of input arguments different of 1

%We open a temporary file to write the string
tmp_nam = tempname;
fid = fopen(tmp_nam, 'w');

%We write the string into a temporary file

%We validate traff string in the next function, by reading from the
%temporary file
[traff_trafficMatrix, errmsg, errorFlag] = IO_readTraffFile(tmp_nam);

Contact us