Распределение офисов между сотрудниками
作者
using Plots
function officeassign(x)
offices = [0.1 0.73;
0.35 0.73;
0.60 0.73;
0.85 0.73;
0.35 0.42;
0.60 0.42;
0.85 0.42]
xoffset = -0.07
yoffset = -0.1
p = plot(size=(800, 600), legend=false, grid=false,
background_color=:white, framestyle=:none)
xlims!(0.03, 1.03)
ylims!(0.1806, 0.9694)
title!("Планировка помещений: окна обозначены голубыми линиями")
for ii in 1:size(offices, 1)
rect_x = offices[ii, 1] + xoffset
rect_y = offices[ii, 2] + yoffset
rect_w = 0.25
rect_h = 0.2
rect_points_x = [rect_x, rect_x + rect_w, rect_x + rect_w, rect_x, rect_x]
rect_points_y = [rect_y, rect_y, rect_y + rect_h, rect_y + rect_h, rect_y]
plot!(rect_points_x, rect_points_y, linecolor=:black, linewidth=1, fillalpha=0)
annotate!(offices[ii, 1], offices[ii, 2], text(x[ii], 10, :black, :center))
end
plot!([offices[5, 1] + xoffset + 0.12, offices[5, 1] + xoffset + 0.2],
[offices[5, 2] + yoffset, offices[5, 2] + yoffset],
linewidth=4, linecolor=:cyan)
plot!([offices[6, 1] + xoffset + 0.05, offices[6, 1] + xoffset + 0.2],
[offices[6, 2] + yoffset, offices[6, 2] + yoffset],
linewidth=4, linecolor=:cyan)
plot!([offices[7, 1] + xoffset + 0.05, offices[7, 1] + xoffset + 0.2],
[offices[7, 2] + yoffset, offices[7, 2] + yoffset],
linewidth=4, linecolor=:cyan)
display(p)
end