亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? basicu.pas

?? 運籌學演示程序之運輸問題
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
        findcixiao:=false;
        for w:=0 to pc-1 do
          if ((done[w,v]>=0)and(cost[w,v]<cixiao)) then
          begin
            if (w<>u) then begin
              cixiao:=cost[w,v]; findcixiao:=true;
            end;
          end;
        if (findcixiao) then
          ban_s[v]:=cixiao-zuixiao
        else ban_s[v]:=0;
      end;
    end;
    for v:=0 to pc-1 do
    begin
      if (ban_p[v]>=0) then
      begin
        zuixiao:=maxint;
        for w:=0 to sc-1 do
          if ((done[v,w]>=0)and(cost[v,w]<zuixiao)) then
          begin
            u:=w;
            zuixiao:=cost[v,w];
          end;
        cixiao:=maxint;
        findcixiao:=false;
        for w:=0 to sc-1 do
          if ((done[v,w]>=0)and(cost[v,w]<cixiao)) then
          begin
            if (w<>u) then begin
              cixiao:=cost[v,w]; findcixiao:=true;
            end;
          end;
        if (findcixiao) then
          ban_p[v]:=cixiao-zuixiao
        else ban_p[v]:=0;
      end;
    end;
  end;
  procedure do_end;
  var w,v,u:byte;
      another:boolean;
  begin
    for w:=0 to pc-1 do
      for v:=0 to sc-1 do
        if (done[w,v]=0) then
        begin
          another:=false;
          for u:=0 to sc-1 do
            if ((u<>v)and(done[w,u]=0)) then another:=true;
          if (another) then
            check_spare_s(amount[w,v],v)
          else
            check_spare_p(amount[w,v],w);
        end;
  end;
BEGIN
  da:=-1;
  setlength(done,pc,sc);
  setlength(ban_p,pc);
  setlength(ban_s,sc);
  for i:=0 to pc-1 do ban_p[i]:=maxint;
  for i:=0 to sc-1 do ban_s[i]:=maxint;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
      done[i,j]:=0;
  min_i:=0;min_j:=0;
  reset_ban;
  repeat
    if (not find_min) then break;
    check_spare_s(spare_s,min_j);
    check_spare_p(spare_p,min_i);
    if (spare_p<spare_s) then
    begin
      amount[min_i,min_j]:=spare_p;
      unenable_p(min_i,min_j);
    end
    else if (spare_s<spare_p) then
    begin
      amount[min_i,min_j]:=spare_s;
      unenable_s(min_i,min_j);
    end
    else begin
      amount[min_i,min_j]:=spare_p;
      unenable_s(min_i,min_j);
      unenable_p(min_i,min_j);
    end;
    reset_ban;
  until all_done;
  do_end;
END;

PROCEDURE zdfy_init(pc,sc:byte;
        produce,sale:array of real;
        cost:matrix;var amount:matrix);
var i,j:byte;
    min,max:real;        //最低費用
    min_i,min_j:byte;    //最低費用點坐標
    spare_p,spare_s:real;
  function find_min:boolean;
  var i,j:integer;get_one:boolean;
  begin
    get_one:=false;
    if (min=-1) then min:=cost[0,0]
    else min:=max;
    for i:=0 to pc-1 do for j:=0 to sc-1 do
    begin
      if ((cost[i,j]<min)and(amount[i,j]=-2)) then
      begin
        min:=cost[i,j];
        min_i:=i; min_j:=j;
        get_one:=true;
      end;
      if (cost[i,j]>max) then max:=cost[i,j];
    end;
    result:=get_one;
  end;
  procedure unenable_s(x,y:byte);
  var i:integer;
  begin
    for i:=0 to pc-1 do
      if ((amount[i,y]=0)and(i<>x)) then amount[i,y]:=-1;
  end;
  procedure unenable_p(x,y:byte);
  var i:integer;
  begin
    for i:=0 to sc-1 do
      if ((amount[x,i]=0)and(i<>y)) then amount[x,i]:=-1;
  end;
  procedure check_spare_s(var s_s:real;y:byte);
  var m:real;i:integer;
  begin
    m:=sale[y];
    for i:=0 to pc-1 do
      if amount[i,y]>0 then m:=m-amount[i,y];
    s_s:=m;
  end;
  procedure check_spare_p(var s_p:real;x:byte);
  var m:real;i:integer;
  begin
    m:=produce[x];
    for i:=0 to sc-1 do
      if amount[x,i]>0 then m:=m-amount[x,i];
    s_p:=m;
  end;
  function all_done:boolean;
  var i,j:integer; done1,done2:boolean;
      count:real;
  begin
    done1:=true;
    for i:=0 to pc-1 do for j:=0 to sc-1 do
      if (amount[i,j]=-2) then done1:=false;
    if (not done1) then
    begin
      done2:=true;
      for i:=0 to pc-1 do
      begin
        count:=0;
        for j:=0 to sc-1 do
          if (amount[i,j]>0) then count:=count+amount[i,j];
        if (count<>produce[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      for i:=0 to sc-1 do
      begin
        count:=0;
        for j:=0 to pc-1 do
          if (amount[i,j]>0) then count:=count+amount[i,j];
        if (count<>sale[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      result:=done2;
    end
    else result:=done1;
  end;
BEGIN
  min:=-1;max:=maxint;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
      amount[i,j]:=-2;          //用-2 表示未做過改動的。
  min_i:=0;min_j:=0;min:=cost[0,0];
  repeat
    if (not find_min) then break;
    check_spare_s(spare_s,min_j);
    check_spare_p(spare_p,min_i);
    if (spare_p<spare_s) then
    begin
      amount[min_i,min_j]:=spare_p;
      unenable_p(min_i,min_j);
    end
    else if (spare_s<spare_p) then
    begin
      amount[min_i,min_j]:=spare_s;
      unenable_s(min_i,min_j);
    end
    else begin
      amount[min_i,min_j]:=spare_p;
      unenable_s(min_i,min_j);
      unenable_p(min_i,min_j);
    end;
  until all_done;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
    if (amount[i,j]=-1) then amount[i,j]:=0;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
    if (amount[i,j]=-2) then amount[i,j]:=0;
END;

PROCEDURE zdfy_d_init(pc,sc:byte;
        produce,sale:array of real;
        cost:matrix;var amount:matrix;
        var grid1:Tstringgrid;var grid2:tstringgrid;
        ptime:dword);
var i,j:byte;
    min,max:real;        //最低費用
    min_i,min_j:byte;    //最低費用點坐標
    spare_p,spare_s:real;
  function find_min:boolean;
  var i,j:integer;get_one:boolean;
  begin
    get_one:=false;
    if (min=-1) then min:=cost[0,0]
    else min:=max;
    for i:=0 to pc-1 do for j:=0 to sc-1 do
    begin
      if ((cost[i,j]<min)and(amount[i,j]=-2)) then
      begin
        min:=cost[i,j];
        min_i:=i; min_j:=j;
        get_one:=true;
      end;
      if (cost[i,j]>max) then max:=cost[i,j];
    end;
    result:=get_one;
  end;
  procedure unenable_s(x,y:byte);
  var i:integer;
  begin
    for i:=0 to pc-1 do
      if ((amount[i,y]=0)and(i<>x)) then amount[i,y]:=-1;
    for i:=0 to pc-1 do
      if (amount[i,y]<=0) then
      begin
       grid2.cells[y+1,i+1]:='--';
       grid1.cells[y+1,i+1]:='*'+floattostr(cost[i,y])+'*';
      end
      else
        grid2.Cells[y+1,i+1]:=floattostr(amount[i,y]);
    grid1.refresh;
    grid2.refresh;
  end;
  procedure unenable_p(x,y:byte);
  var i:integer;
  begin
    for i:=0 to sc-1 do
      if ((amount[x,i]=0)and(i<>y)) then amount[x,i]:=-1;
    for i:=0 to sc-1 do
      if (amount[x,i]<=0)then
      begin
        grid2.cells[i+1,x+1]:='--';
        grid1.cells[i+1,x+1]:='*'+floattostr(cost[x,i])+'*';
      end
      else
        grid2.Cells[i+1,x+1]:=floattostr(amount[x,i]);
    grid1.refresh;
    grid2.refresh;
  end;
  procedure check_spare_s(var s_s:real;y:byte);
  var m:real;i:integer;
  begin
    m:=sale[y];
    for i:=0 to pc-1 do
      if amount[i,y]>0 then m:=m-amount[i,y];
    s_s:=m;
  end;
  procedure check_spare_p(var s_p:real;x:byte);
  var m:real;i:integer;
  begin
    m:=produce[x];
    for i:=0 to sc-1 do
      if amount[x,i]>0 then m:=m-amount[x,i];
    s_p:=m;
  end;
  function all_done:boolean;
  var i,j:integer; done1,done2:boolean;
      count:real;
  begin
    done1:=true;
    for i:=0 to pc-1 do for j:=0 to sc-1 do
      if (amount[i,j]=-2) then done1:=false;
    if (not done1) then
    begin
      done2:=true;
      for i:=0 to pc-1 do
      begin
        count:=0;
        for j:=0 to sc-1 do
          if (amount[i,j]>0) then count:=count+amount[i,j];
        if (count<>produce[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      for i:=0 to sc-1 do
      begin
        count:=0;
        for j:=0 to pc-1 do
          if (amount[i,j]>0) then count:=count+amount[i,j];
        if (count<>sale[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      result:=done2;
    end
    else result:=done1;
  end;
BEGIN
  min:=-1;max:=maxint;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
      amount[i,j]:=-2;          //用-2 表示未做過改動的。
  for i:=1 to pc do
    for j:=1 to sc do
      grid1.cells[j,i]:=floattostr(cost[i-1,j-1]);
  for i:=1 to pc do
    grid1.cells[0,i]:=inttostr(i);
  for j:=1 to sc do
    grid1.cells[j,0]:=inttostr(j);
  grid1.Refresh;
  grid2.cells[0,0]:='產\銷量';
  for i:=1 to pc do
    grid2.cells[0,i]:=floattostr(produce[i-1]);
  for j:=1 to sc do
    grid2.cells[j,0]:=floattostr(sale[j-1]);
  grid2.refresh;
  min_i:=0;min_j:=0;min:=cost[0,0];
  repeat
    if (not find_min) then break;
    check_spare_s(spare_s,min_j);
    check_spare_p(spare_p,min_i);
    if (spare_p<spare_s) then
    begin
      amount[min_i,min_j]:=spare_p;
      unenable_p(min_i,min_j);
    end
    else if (spare_s<spare_p) then
    begin
      amount[min_i,min_j]:=spare_s;
      unenable_s(min_i,min_j);
    end
    else begin
      amount[min_i,min_j]:=spare_p;
      unenable_s(min_i,min_j);
      unenable_p(min_i,min_j);
    end;
    pause(ptime);
  until all_done;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
    if (amount[i,j]=0) then
    begin
      grid1.cells[j+1,i+1]:='*'+floattostr(cost[i,j])+'*';
      grid2.cells[j+1,i+1]:='--';
    end;
  grid1.refresh;
  grid2.refresh;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
    if (amount[i,j]=-1) then amount[i,j]:=0;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
    if (amount[i,j]=-2) then amount[i,j]:=0;
END;

PROCEDURE xbj_init(pc,sc:byte;
        produce,sale:array of real;
        var amount:matrix);
var i,j:byte;
    spare:real;     //每步剩余量
    where:boolean;  //剩余量是銷方還是產方。T:銷,F:產
    tp,ts:real;
BEGIN
  for i:=0 to pc-1 do for j:=0 to sc-1 do
    amount[i,j]:=0;
  i:=0;j:=0;spare:=0;where:=false;
  repeat
    tp:=produce[i];
    ts:=sale[j];
    if (spare<>0)then
    begin
     if (where) then
      ts:=spare
     else
      tp:=spare;
    end;
    if (tp>ts) then
    begin
      amount[i,j]:=ts;
      spare:=tp-ts;
      where:=false;
      j:=j+1;
    end
    else if (tp<ts) then
    begin
      amount[i,j]:=tp;
      spare:=ts-tp;
      where:=true;
      i:=i+1;
    end
    else
    begin
      amount[i,j]:=tp;
      spare:=0;
      i:=i+1;
      j:=j+1;
    end;
  until (i>(pc-1))or(j>(sc-1));
END;

PROCEDURE xbj_d_init(pc,sc:byte;
        produce,sale:array of real;
        var amount:matrix;var grid:Tstringgrid;
        ptime:dword);
var i,j:byte;
    spare:real;     //每步剩余量
    where:boolean;  //剩余量是銷方還是產方。T:銷,F:產
    tp,ts:real;
BEGIN
  grid.cells[0,0]:='產\銷量';
  for i:=1 to pc do
    grid.cells[0,i]:=floattostr(produce[i-1]);
  for j:=1 to sc do
    grid.cells[j,0]:=floattostr(sale[j-1]);
  grid.refresh;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
    amount[i,j]:=0;
  i:=0;j:=0;spare:=0;where:=false;
  repeat
    tp:=produce[i];
    ts:=sale[j];
    if (spare<>0)then
    begin
     if (where) then
      ts:=spare
     else
      tp:=spare;
    end;               
    if (tp>ts) then
    begin
      amount[i,j]:=ts;
      grid.Cells[j+1,i+1]:=floattostr(ts);
      spare:=tp-ts;
      where:=false;
      j:=j+1;
    end
    else if (tp<ts) then
    begin
      amount[i,j]:=tp;
      grid.Cells[j+1,i+1]:=floattostr(tp);
      spare:=ts-tp;
      where:=true;
      i:=i+1;
    end
    else
    begin
      amount[i,j]:=tp;
      grid.Cells[j+1,i+1]:=floattostr(tp);
      spare:=0;
      i:=i+1;
      j:=j+1;
    end;
    grid.refresh;
    pause(ptime);
  until (i>(pc-1))or(j>(sc-1));
  for i:=1 to pc do for j:=1 to sc do
    grid.cells[j,i]:=floattostr(amount[i-1,j-1]);
  grid.refresh;
END;


end.


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩不卡免费| 亚洲激情第一区| 国产一区二区看久久| 欧美日韩激情一区二区| 亚洲综合久久av| 777午夜精品免费视频| 日韩激情视频在线观看| 欧美最猛性xxxxx直播| 亚洲国产精品视频| www激情久久| kk眼镜猥琐国模调教系列一区二区| 久久久噜噜噜久久中文字幕色伊伊| 日本最新不卡在线| 久久蜜臀精品av| 欧美日韩在线播| 波多野洁衣一区| 另类小说欧美激情| 色8久久精品久久久久久蜜| 欧美成人a∨高清免费观看| 九色综合国产一区二区三区| 国产精品乱码人人做人人爱 | 福利一区二区在线观看| 日本一区二区久久| 3d成人h动漫网站入口| 99热精品国产| 国产精品一区在线| 免费成人av在线播放| 一区二区三区中文字幕| 国产精品福利av| 欧美国产精品一区| 精品999久久久| 久久综合久久99| 欧美变态tickling挠脚心| 欧美精品乱码久久久久久| 91免费小视频| 欧美婷婷六月丁香综合色| 色综合色狠狠综合色| 99久久精品费精品国产一区二区| 国产成人a级片| hitomi一区二区三区精品| 成人一区二区三区在线观看| 国产一区二区导航在线播放| 国内不卡的二区三区中文字幕| 美国精品在线观看| 国产自产2019最新不卡| 成人久久久精品乱码一区二区三区| 狠狠色综合日日| 色婷婷激情久久| 日韩精品影音先锋| 久久久久久久久久久久久久久99| 欧美韩日一区二区三区四区| 亚洲欧洲日韩女同| 午夜精品久久久久久久| 欧美96一区二区免费视频| 国产乱码一区二区三区| 一本大道综合伊人精品热热| 欧美久久久久免费| 中文在线免费一区三区高中清不卡| 国产精品久久久久久久久搜平片| 亚洲综合色视频| 国产很黄免费观看久久| 欧美日韩亚洲国产综合| 欧美精品一区在线观看| 亚洲精品高清视频在线观看| 美女www一区二区| 91精品久久久久久久99蜜桃 | 国产精品一区免费在线观看| 成人动漫精品一区二区| 欧美电影精品一区二区| 亚洲人成网站影音先锋播放| 日韩中文字幕一区二区三区| 成人开心网精品视频| 精品欧美一区二区三区精品久久| 亚洲欧洲日韩在线| 国产一区二区三区四区五区入口 | 欧美丰满美乳xxx高潮www| 欧美国产国产综合| 国产老肥熟一区二区三区| 在线成人av影院| 婷婷综合久久一区二区三区| 免费成人你懂的| 成人性生交大合| 中文字幕一区二区在线观看| 丁香婷婷综合五月| 日本一区二区三区在线观看| 国产成人欧美日韩在线电影| 国产亚洲欧美在线| 国产精品一区二区x88av| 久久精品视频免费| 91蜜桃在线免费视频| 亚洲国产视频一区| 精品少妇一区二区三区视频免付费| 精品亚洲成a人在线观看| 久久久国际精品| av网站免费线看精品| 亚洲福利视频一区二区| 日韩精品资源二区在线| 99精品视频一区二区| 日本强好片久久久久久aaa| 国产日韩欧美精品一区| 色综合天天天天做夜夜夜夜做| 日韩av在线播放中文字幕| 中文av一区特黄| 日韩欧美在线不卡| 91官网在线免费观看| 国产成人精品一区二区三区网站观看| 亚洲人成精品久久久久| 精品日韩成人av| 日韩小视频在线观看专区| 成人午夜在线视频| 麻豆一区二区三区| 亚洲国产日日夜夜| 亚洲激情图片qvod| 亚洲精品国产一区二区精华液| 欧美美女bb生活片| 99久免费精品视频在线观看| 国产真实精品久久二三区| 蜜桃一区二区三区在线| 亚洲国产一二三| 日韩在线观看一区二区| 日韩中文字幕区一区有砖一区| 亚洲精品中文字幕在线观看| 亚洲精品视频一区| 亚洲18色成人| 奇米色777欧美一区二区| 亚洲成a人v欧美综合天堂| 亚洲.国产.中文慕字在线| 日韩专区中文字幕一区二区| 偷窥少妇高潮呻吟av久久免费| 日韩精品久久理论片| 蜜桃av噜噜一区| 成人午夜短视频| 欧美日韩在线播放| 国产亚洲成aⅴ人片在线观看| 欧美国产精品久久| 成人欧美一区二区三区1314| 亚洲欧洲日韩综合一区二区| 亚洲一线二线三线久久久| 午夜精品久久久久久久99樱桃| 奇米888四色在线精品| 国产成人在线视频播放| 欧洲另类一二三四区| 久久无码av三级| 亚洲乱码中文字幕| 国产美女在线观看一区| 色综合久久久久久久| 欧美午夜寂寞影院| 国产精品网友自拍| 美女一区二区久久| 欧美三级午夜理伦三级中视频| 久久蜜桃一区二区| 免费一级片91| 在线视频国内自拍亚洲视频| 国产拍揄自揄精品视频麻豆| 亚洲国产成人porn| 欧美在线免费播放| 亚洲自拍偷拍图区| 在线综合视频播放| 精品视频免费看| 26uuu亚洲综合色| 国产专区欧美精品| 精品少妇一区二区三区在线视频| 亚洲综合在线免费观看| 91网址在线看| 亚洲欧洲日韩女同| 欧美午夜影院一区| 亚洲成a人在线观看| 91精品国产免费久久综合| 亚洲成年人影院| 欧美大片国产精品| 久久99精品久久久久久动态图 | 99久久国产综合精品色伊| www国产成人免费观看视频 深夜成人网| 免费成人av在线| 国产亚洲一区二区在线观看| 成人激情校园春色| 亚洲国产精品久久久久秋霞影院| 欧美日韩国产高清一区二区三区 | 国产清纯在线一区二区www| 成人免费视频一区二区| 亚洲一二三区不卡| 国产午夜精品一区二区三区视频 | 96av麻豆蜜桃一区二区| 亚洲福中文字幕伊人影院| www激情久久| 欧美日韩国产高清一区| 国产精品正在播放| 毛片不卡一区二区| 一区二区三区丝袜| 国产欧美日韩麻豆91| 欧美浪妇xxxx高跟鞋交| 不卡视频在线看| 国产精品一区二区不卡| 日本不卡1234视频| 午夜电影网一区| 日韩电影在线观看电影| 一区二区三区日韩欧美| 国产精品传媒视频| 国产女同性恋一区二区| 日韩一区二区在线观看视频播放|