1 Star 1 Fork 1

陈帅/Stackelberg-Game11

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
script.m 2.92 KB
一键复制 编辑 原始数据 按行查看 历史
Li Yu 提交于 2019-11-09 04:19 . Upload all m files
%%
clear
clc
parameters(1) = 12; %T
parameters(2) = 0.05;%rho
parameters(3) = 0.5; %mu1
parameters(4) = 0.1; %mu2
parameters(5) = 0.1; %mu3
parameters(6) = 0.5; %alpha
parameters(7) = 0.0; %beta
parameters(8) = 0.0; %gamma
parameters(9) = 100; %theta
parameters(10) = 100; %c0
parameters(11) = 0.0; %lambda
parameters(12) = 0.0; %eta
parameters(13) = 1.0; %k1
parameters(14) = 1.0; %k2
parameters(15) = 0.0; %g1
parameters(16) = 0.0; %g2
x_init = [120;0];
[tick,ref_p,quantity,ret_p,adv_l,who_p,qual_l,demand,cost] = app(parameters,x_init,1);
%%
figure
hold on
%r-demand
plot(ref_p,demand,'-b' ,'LineWidth',1.2)
%p-demand
plot(ret_p,demand,'--g','LineWidth',1.2)
%w-demand
plot(who_p,demand,'-.r','LineWidth',1.2)
ylabel({'$D$'},'Interpreter','latex','fontsize',17);
h=legend(...
'$r$',...
'$p$',...
'$w$',...
'Location','southeast');
set(h,'Interpreter','latex');
set(h,'FontSize',17);
box on
grid on
grid minor
saveas(gcf,'rpw_D','epsc')
hold off
%%
figure
hold on
%t-r
plot(tick, ref_p,'-b' ,'LineWidth',1.2)
%t-p
plot(tick, ret_p,'--g','LineWidth',1.2)
%t-w
plot(tick, who_p,'-.r','LineWidth',1.2)
xlabel({'$t$'},'Interpreter','latex','fontsize',17);
h=legend(...
'$r$',...
'$p$',...
'$w$',...
'Location','southeast');
set(h,'Interpreter','latex');
set(h,'FontSize',17);
box on
grid on
grid minor
saveas(gcf,'t_rpw_sc','epsc')
hold off
%%
subplot(2,2,1)
hold on
%t-r
plot(tick, ref_p,'-b' ,'LineWidth',1.2)
%t-p
plot(tick, ret_p,'--g','LineWidth',1.2)
%t-w
plot(tick, who_p,'-.r','LineWidth',1.2)
xlabel({'$t$'},'Interpreter','latex','fontsize',17);
axis([0,12,120,180])
h=legend(...
'$r$',...
'$p$',...
'$w$',...
'Location','southeast');
set(h,'Interpreter','latex');
set(h,'FontSize',17);
box on
grid on
grid minor
hold off
%t-Q
subplot(2,2,2)
plot(tick, quantity,'LineWidth',1.2)
xlabel({'$t$'},'Interpreter','latex','fontsize',17);
ylabel({'$Q$'},'Interpreter','latex','fontsize',17);
axis([0,12,-inf,inf])
box on
grid on
grid minor
subplot(2,2,3)
plot(tick, adv_l,'--g' ,'LineWidth',1.2)
xlabel({'$t$'},'Interpreter','latex','fontsize',17);
ylabel({'$l$'},'Interpreter','latex','fontsize',17);
axis([0,12,-1,1])
box on
grid on
grid minor
subplot(2,2,4)
plot(tick, qual_l,'-.r','LineWidth',1.2)
xlabel({'$t$'},'Interpreter','latex','fontsize',17);
ylabel({'$d$'},'Interpreter','latex','fontsize',17);
axis([0,12,-1,1])
box on
grid on
grid minor
saveas(gcf,'t_rpwQld_sc','epsc')
%%
figure%t-cost
plot(tick, cost,'LineWidth',1.2)
xlabel({'$t$'},'Interpreter','latex','fontsize',17);
ylabel({'$c$'},'Interpreter','latex','fontsize',17);
box on
grid on
grid minor
saveas(gcf,'t_c','epsc')
%%
figure%t-demand
plot(tick, demand,'LineWidth',1.2)
xlabel({'$t$'},'Interpreter','latex','fontsize',17);
ylabel({'$D$'},'Interpreter','latex','fontsize',17);
box on
grid on
grid minor
saveas(gcf,'t_D','epsc')
%%
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lowtohigh/stackelberg-game1111.git
git@gitee.com:lowtohigh/stackelberg-game1111.git
lowtohigh
stackelberg-game1111
Stackelberg-Game11
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385