Code covered by the BSD License  

Highlights from
CTMSIM - an interactive freeway traffic macrosimulator

image thumbnail
from CTMSIM - an interactive freeway traffic macrosimulator by Alex Kurzhanskiy
Freeway traffic simulation based on Asymmetric Cell Transmission Model

rdGUIclose()
function rdGUIclose()
% RDGUICLOSE - saves data if necessary, performs cleanup and closes 'rdGUI' window;
%              this function neither takes nor returns any parameters.
%
% Last modified:   09/05/2006.

%
% Alex Kurzhanskiy   <akurzhan@eecs.berkeley.edu>
%

global g_ctmGUI;
global g_rdGUI;

if g_rdGUI.OK == 1  % save data in 'g_ctmGUI' data structure
  g_ctmGUI.inflow   = g_rdGUI.inflow;
  g_ctmGUI.outflow  = g_rdGUI.outflow;
  g_ctmGUI.cellData = g_rdGUI.cellData;
  g_ctmGUI.orflows  = get_or_flows(g_rdGUI.cellData)';
  g_ctmGUI.frbetas  = get_fr_splitratios(g_rdGUI.cellData)';
  g_ctmGUI.isSaved  = 0;
end

clear global g_rdGUI;

% close GUI
shh     = get(0, 'ShowHiddenHandles');
set(0, 'ShowHiddenHandles', 'on');
currFig = get(0, 'CurrentFigure');
set(0, 'ShowHiddenHandles', shh);
delete(currFig);

g_ctmGUI.isStopped = 1;

return;

Contact us at files@mathworks.com