Revert "Merge branch 'main' of https://cau-git.rz.uni-kiel.de/nt/mitarbeiter/silas/imdd_simulation"
This reverts commit 798a0ca3b3
This commit is contained in:
@@ -6,7 +6,7 @@ db = DBHandler("dataBase", "labor_highspeed", "type", database_type);
|
||||
|
||||
pam_levels = [4, 6, 8]; % three tiles
|
||||
bitrate_set = 360e9;
|
||||
fiberL = 2;
|
||||
fiberL = 10;
|
||||
|
||||
fields = [
|
||||
db.getTableFieldNames('power_state_info');
|
||||
@@ -96,7 +96,7 @@ end
|
||||
%% ============================================================
|
||||
% PLOT — 1×3 (PAM-4, PAM-6, PAM-8)
|
||||
% ============================================================
|
||||
fig = figure(9112); clf;
|
||||
fig = figure(9110); clf;
|
||||
tiledlayout(1,3,'TileSpacing','compact','Padding','compact');
|
||||
|
||||
lw = 1.8;
|
||||
@@ -223,19 +223,19 @@ ylabel('');
|
||||
|
||||
end
|
||||
|
||||
% pos = 1e3.*[2.7770 1.2017 1.4000 0.3200];
|
||||
% set(fig, 'Position', pos);
|
||||
pos = 1e3.*[2.7770 1.2017 1.4000 0.3200];
|
||||
set(fig, 'Position', pos);
|
||||
|
||||
%% === EXPORT ===
|
||||
% outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\wavelength_analysis.tikz';
|
||||
% matlab2tikz(outfile, ...
|
||||
% 'width','\fwidth', ...
|
||||
% 'height','\fheight', ...
|
||||
% 'showInfo',false, ...
|
||||
% 'extraAxisOptions',{ ...
|
||||
% 'legend style={font=\footnotesize}', ...
|
||||
% 'legend columns=1' ...
|
||||
% });
|
||||
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\wavelength_analysis.tikz';
|
||||
matlab2tikz(outfile, ...
|
||||
'width','\fwidth', ...
|
||||
'height','\fheight', ...
|
||||
'showInfo',false, ...
|
||||
'extraAxisOptions',{ ...
|
||||
'legend style={font=\footnotesize}', ...
|
||||
'legend columns=1' ...
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,139 +1,83 @@
|
||||
tablename = 'C:\Users\Silas\Documents\latex\JLT_400G_submission\HighSpeedExperiments_oneandonly_csv.csv';
|
||||
% Returns a Table
|
||||
data = readtable(tablename,"Delimiter",';','DecimalSeparator',',');
|
||||
|
||||
|
||||
%% ============================================================
|
||||
% PLOT
|
||||
% ============================================================
|
||||
%% 1. DATA EXTRACTION & SETUP
|
||||
%% 1. DATA EXTRACTION & SETUP
|
||||
raw_M = data.M;
|
||||
raw_baud = data.BaudRate;
|
||||
raw_net = data.NetRate;
|
||||
raw_codes = string(data.ZoteroCode);
|
||||
raw_names = string(data.Name);
|
||||
raw_band = string(data.Band);
|
||||
|
||||
% Filter Valid Data
|
||||
target_M = [2, 4, 6, 8];
|
||||
validIdx = ismember(raw_M, target_M) & ~isnan(raw_baud) & ~isnan(raw_net);
|
||||
|
||||
Mvals = raw_M(validIdx);
|
||||
baud = raw_baud(validIdx);
|
||||
netrate = raw_net(validIdx);
|
||||
codes = raw_codes(validIdx);
|
||||
names = raw_names(validIdx);
|
||||
bands = raw_band(validIdx);
|
||||
|
||||
pam_list = target_M;
|
||||
colors = flip(cbrewer2('SET1',4));
|
||||
|
||||
%% 2. PLOT (For Visual Check only)
|
||||
figure; hold on;
|
||||
ms = 20;
|
||||
lw = 0.5;
|
||||
ms = 32; % scatter size
|
||||
lw = 0.8; % line width
|
||||
|
||||
for k = 1:4 % PAM-2/4/6/8
|
||||
|
||||
for k = 1:length(pam_list)
|
||||
M = pam_list(k);
|
||||
idxPam = (Mvals == M);
|
||||
|
||||
|
||||
% Extract for this PAM
|
||||
x = baud(idxPam);
|
||||
y = netrate(idxPam);
|
||||
b = bands(idxPam);
|
||||
n = names(idxPam);
|
||||
|
||||
% Get color for this PAM format
|
||||
col = colors(k,:);
|
||||
|
||||
|
||||
% ----- LEGEND FLAG (only add one entry per PAM) -----
|
||||
firstLegend = true;
|
||||
|
||||
|
||||
% ---- PLOT ALL POINTS (marker based on publication) ----
|
||||
for i = 1:sum(idxPam)
|
||||
|
||||
% Marker Logic
|
||||
ms = 20;
|
||||
if strcmpi(b(i), 'O')
|
||||
marker = 'o';
|
||||
elseif strcmpi(b(i), 'C')
|
||||
marker = 'd';
|
||||
else
|
||||
marker = 's';
|
||||
end
|
||||
if strcmpi(n(i), 'THIS WORK')
|
||||
marker = 'pentagram';
|
||||
ms = 100;
|
||||
end
|
||||
|
||||
% Plot Scatter
|
||||
% marker selection by publication
|
||||
pubIdx = find(pub_list == n(i), 1);
|
||||
marker = markerlist{mod(pubIdx-1, nMarkers) + 1};
|
||||
|
||||
if firstLegend
|
||||
scatter(x(i), y(i), ms, 'Marker', marker, ...
|
||||
'MarkerEdgeColor', col, 'MarkerFaceColor', col, ...
|
||||
h = scatter(x(i), y(i), ms, ...
|
||||
'Marker', marker, ...
|
||||
'MarkerEdgeColor', col, ...
|
||||
'MarkerFaceColor', col, ...
|
||||
'DisplayName', sprintf('PAM-%d', M));
|
||||
firstLegend = false;
|
||||
else
|
||||
scatter(x(i), y(i), ms, 'Marker', marker, ...
|
||||
'MarkerEdgeColor', col, 'MarkerFaceColor', col, ...
|
||||
h = scatter(x(i), y(i), ms, ...
|
||||
'Marker', marker, ...
|
||||
'MarkerEdgeColor', col, ...
|
||||
'MarkerFaceColor', col, ...
|
||||
'HandleVisibility','off');
|
||||
end
|
||||
|
||||
% ====== CUSTOM DATATIP CONTENT ======
|
||||
dt = h.DataTipTemplate;
|
||||
dt.DataTipRows(1).Label = 'Baud rate';
|
||||
dt.DataTipRows(2).Label = 'Net rate';
|
||||
|
||||
% Add publication name
|
||||
dt.DataTipRows(end+1) = dataTipTextRow('Publication', n(i));
|
||||
|
||||
|
||||
end
|
||||
|
||||
% Fit lines
|
||||
if length(x) >= 3
|
||||
[p, S, mu] = polyfit(x, y, 2);
|
||||
xfit = linspace(min(x), max(x), 200);
|
||||
yfit = polyval(p, xfit, S, mu);
|
||||
plot(xfit, yfit, '-', 'LineWidth', lw, 'Color', col, 'HandleVisibility', 'off');
|
||||
|
||||
% ---- Fit (PAM-specific) ----
|
||||
valid = ~isnan(x) & ~isnan(y);
|
||||
if sum(valid) >= 3
|
||||
p = polyfit(x(valid), y(valid), 2);
|
||||
xfit = linspace(min(x(valid)), max(x(valid)), 200);
|
||||
yfit = polyval(p, xfit);
|
||||
|
||||
plot(xfit, yfit, ':', ...
|
||||
'LineWidth', lw, ...
|
||||
'Color', col, ...
|
||||
'HandleVisibility', 'off'); % do NOT add to legend
|
||||
end
|
||||
end
|
||||
|
||||
grid on; box on;
|
||||
grid on;
|
||||
xlabel('Baud rate [GBd]');
|
||||
ylabel('Net rate [Gb/s]');
|
||||
% title('Check Command Window for TikZ Code');
|
||||
% legend('Location','northwest');
|
||||
|
||||
%% 3. GENERATE TIKZ ANNOTATION CODE
|
||||
% This prints the manual \draw commands to the console
|
||||
legend('Location','northwest');
|
||||
set(gca,'FontSize',11);
|
||||
|
||||
%% GENERATE TIKZ ANNOTATION CODE
|
||||
% This prints the manual \draw commands to the console
|
||||
|
||||
%% GENERATE TIKZ ANNOTATION CODE (Colored Borders + Tiny Font)
|
||||
%% GENERATE TIKZ ANNOTATION CODE (No Arrow, Close Text)
|
||||
fprintf('\n\n%% ===========================================================\n');
|
||||
fprintf('%% COPY THE FOLLOWING LINES INTO YOUR .TEX FILE \n');
|
||||
fprintf('%% (Paste them just before \\end{axis})\n');
|
||||
fprintf('%% ===========================================================\n\n');
|
||||
|
||||
for i = 1:length(baud)
|
||||
bx = baud(i);
|
||||
by = netrate(i);
|
||||
key = codes(i);
|
||||
M_val = Mvals(i);
|
||||
|
||||
% --- PLACEMENT LOGIC ---
|
||||
if M_val == 8
|
||||
% PAM-8: Place Top-Left
|
||||
% 'south east' anchor means the text's bottom-right corner touches the coordinate
|
||||
% shift moves it slightly up and left to clear the marker
|
||||
anchorStr = 'south east';
|
||||
shiftStr = 'shift={(-3pt, 3pt)}';
|
||||
else
|
||||
% Others: Place Bottom-Right
|
||||
% 'north west' anchor means the text's top-left corner touches the coordinate
|
||||
% shift moves it slightly down and right
|
||||
anchorStr = 'north west';
|
||||
shiftStr = 'shift={(3pt, -3pt)}';
|
||||
end
|
||||
|
||||
% --- PRINT COMMAND ---
|
||||
% Uses \node directly at the coordinate (axis cs:...)
|
||||
fprintf('\\node[anchor=%s, %s, font=\\tiny, fill=white, inner sep=1pt] at (axis cs:%.2f, %.2f) {\\cite{%s}};\n', ...
|
||||
anchorStr, shiftStr, bx, by, key);
|
||||
end
|
||||
fprintf('\n')
|
||||
|
||||
%% === EXPORT ===
|
||||
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G_submission\media\matlab2tikz\highspeedresults_test.tikz';
|
||||
|
||||
outfile = 'C:\Users\Silas\Documents\latex\JLT_400G copy\media\matlab2tikz\highspeedresults.tikz';
|
||||
matlab2tikz(outfile, ...
|
||||
'width','\fwidth', ...
|
||||
'height','\fheight', ...
|
||||
|
||||
@@ -10,11 +10,10 @@ if dsp_options.mode == "load_run_id"
|
||||
|
||||
if experiment == "highspeed_2024"
|
||||
|
||||
dsp_options.database_type = "mysql";
|
||||
dsp_options.database_type = 'mysql';
|
||||
dsp_options.dataBase = 'labor_highspeed';%'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\silas_labor_newdsp_newstructure.db';
|
||||
dsp_options.storage_path = 'Z:\2024\sioe_labor\';
|
||||
db = DBHandler("dataBase", [dsp_options.dataBase],...
|
||||
"type", dsp_options.database_type,"server","192.168.178.192","user","silas","password","silas");
|
||||
db = DBHandler("dataBase", [dsp_options.dataBase], "type", dsp_options.database_type);
|
||||
|
||||
elseif experiment == "mpi_ecoc_2025"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user