No BSD License  

Highlights from
MatPlanWDM v0.5

image thumbnail
from MatPlanWDM v0.5 by Pablo Pavon MariƱo
Educational network planning tool for the RWA problem in WDM networks (MILP and heuristic based)

rowNormalization(varargin)
function varargout = rowNormalization(varargin)
% ROWNORMALIZATION M-file for rowNormalization.fig
%      ROWNORMALIZATION, by itself, creates a new ROWNORMALIZATION or raises the existing
%      singleton*.
%
%      H = ROWNORMALIZATION returns the handle to a new ROWNORMALIZATION or the handle to
%      the existing singleton*.
%
%      ROWNORMALIZATION('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in ROWNORMALIZATION.M with the given input arguments.
%
%      ROWNORMALIZATION('Property','Value',...) creates a new ROWNORMALIZATION or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before rowNormalization_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to rowNormalization_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help rowNormalization

% Last Modified by GUIDE v2.5 16-Oct-2007 21:28:32

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @rowNormalization_OpeningFcn, ...
                   'gui_OutputFcn',  @rowNormalization_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before rowNormalization is made visible.
function rowNormalization_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to rowNormalization (see VARARGIN)

% Choose default command line output for rowNormalization
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes rowNormalization wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = rowNormalization_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %offeredTraffic_edit - OUTGOING OFFERED TRAFFIC PER NODE
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function offeredTraffic_edit_Callback(hObject, eventdata, handles)
% hObject    handle to offeredTraffic_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of offeredTraffic_edit as text
%        str2double(get(hObject,'String')) returns contents of offeredTraffic_edit as a double


% --- Executes during object creation, after setting all properties.
function offeredTraffic_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to offeredTraffic_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%trafficMatrix_edit - TRAFFIC MATRIX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function trafficMatrix_edit_Callback(hObject, eventdata, handles)
% hObject    handle to trafficMatrix_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of trafficMatrix_edit as text
%        str2double(get(hObject,'String')) returns contents of trafficMatrix_edit as a double


% --- Executes during object creation, after setting all properties.
function trafficMatrix_edit_CreateFcn(hObject, eventdata, handles)
% hObject    handle to trafficMatrix_edit (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Apply_pushbutton - Pushbutton to save the Traffic Matrix defined by
%the user
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% --- Executes on button press in Apply_pushbutton.
function Apply_pushbutton_Callback(hObject, eventdata, handles)
% hObject    handle to Apply_pushbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


load_global_traffGen;

auxOfferedTraffic=str2num(get(handles.offeredTraffic_edit,'String'));
if isempty(auxOfferedTraffic), 
    errordlg('The outgoing offered traffic per node must be a positive number','Incorrect Value','modal');
    return
elseif length(find(auxOfferedTraffic<=0))>0,
    errordlg('The outgoing offered traffic per node must be a positive number','Incorrect Value','modal');
    return
elseif length(auxOfferedTraffic)~=size(provTrafficMatrix,1),
    errorMessage=['The number of items must be ', num2str(size(provTrafficMatrix,1)), ' (number of nodes)'];
    errordlg(errorMessage,'Incorrect Value','modal');
    return
else
    offeredTraffic=auxOfferedTraffic;
end

close;



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Cancel_pushbutton - Pushbutton to cancel the Traffic Generation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% --- Executes on button press in Cancel_pushbutton.
function Cancel_pushbutton_Callback(hObject, eventdata, handles)
% hObject    handle to Cancel_pushbutton (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

close;










Contact us at files@mathworks.com