QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 2417|回复: 11
打印 上一主题 下一主题

lingo编程遇到问题,还望帮助

[复制链接]
字体大小: 正常 放大

1

主题

1

听众

3

积分

升级  60%

该用户从未签到

自我介绍
编程入门,虚心好学
跳转到指定楼层
1#
发表于 2015-1-25 20:12 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
题目大概意思是:7个节点,彼此之间存在物流量w和距离d,要从中选出3个作为枢纽,但作为枢纽便有建设费用f,单位距离单位物流的成本为c,每个普通节点有且仅连接1个枢纽,且普通节点到枢纽的运输享受折扣a1,枢纽之间享受折扣a。现在建立模型,并用lingo求解。模型我已建,lingo也编写了,但是遇到了问题,希望有网友能够帮我解决。(具体的值我都已经赋好了,参见程序中)
                              

lingo编程如下:
model:
  sets:
   spoke/s1,s2,s3,s4,s5,s6,s7/:y,F;
   link(spoke,spoke,spoke,spoke):w,d;
  data:
    d=0 18.8 17.7 97.8 68 36.847.9
      18.8 0 36.2 98.7 5927.7 35.6
      17.7 36.2 0 112.6 82.851.6 65.3
      97.8 98.7 112.6 0 76.297.5 105.4
      68 59 82.8 76.2 0 33.934.9
      36.8 27.7 51.6 97.533.9 0 23.5
      47.9 35.6 63.3 105.434.9 23.5 0;

    w=0,36.14,37.11,32.96,41.05,35.82,28.32,
     41.63,0,19.62,17.42,21.70,18.94,14.97,
     42.60,19.55,0,17.83,22.21,19.38,15.32,
     38.41,17.62,18.10,0,20.02,17.47,13.81,
     46.48,21.33,21.90,19.45,0,21.14,16.71,
     41.31,18.96,19.47,17.29,21.53,0,14.86,
     33.57,15.40,15.82,14.05,17.50,15.27,0;
   F=50000,50000,50000,30000,30000,30000,30000;
    c=50;
    a=0.7;
    a1=0.9;
    N=7;
  enddata
   min=@sum(spoke(k):y(k)*F(k))+@sum(spoke(i):@sum(spoke(j):@sum(spoke(k):@sum(spoke(m):w(i,j)*a1*d(i,k)*c+w(i,j)*a1*d(m,j)*c))))
      +@sum(spoke(k):@sum(spoke(m)|k#NE#m:c*a*w(i,j)*d(m,j)));
    @sum(spoke(k):y(k)=3);
   @for(spoke(i):@for(spoke(k):@for(spoke(m):@for(spoke(j):x(i,k,m,j)<=y(k)))));
   @for(spoke(i):@for(spoke(k):@for(spoke(m):@for(spoke(j):x(i,k,m,j)<=y(m)))));
   @for(spoke(i):@sum(spoke(k):x(i,k,m,j)=1));
   @for(spoke(j):@sum(spoke(m):x(i,k,m,j)=1));
  end
      在lingo里运行总是有问题,可是以自己现在的能力,暂时也不知道是怎么回事了,希望能有吧友帮帮忙,帮我看看,在此感谢了。



zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信

1

主题

1

听众

3

积分

升级  60%

该用户从未签到

自我介绍
编程入门,虚心好学
回复

使用道具 举报

2

主题

12

听众

136

积分

升级  18%

  • TA的每日心情
    开心
    2015-2-6 08:35
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    社区QQ达人

    Team # 26333 Page 51 of 53
    In the heavy traffic case, pexit will increase the utilization ratio of the rightmost
    lane. This reasonable because a large number of vehicles tend to use the rightmost
    lane to move into the off-ramp.
    9.3.4 Failure Ratio
    A significant difference in our refined model is that some vehicles might fail
    to move to the exit of the freeway, a common situation in the real world. The
    failure ratio is defined as the ratio of the number of the vehicles failing to exit
    to the total number of vehicles. We seek to investigate how failure rate changes
    with varying pexit.
    Figure 33 Failure ratio in light & heavy traffic (different pexit)
    Figure 33 demonstrate that in the case of light traffic, pexit is an irrelevant factor.
    The vehicles can move to the rightmost lane with ease. pexit plays an important
    role in the heavy traffic case. When pexit remains low, the average speed is
    relatively high, which makes moving to the rightmost lane extremely difficult.
    When pexit becomes high, the average speed slows down. Vehicles have more
    time to move to the rightmost lane, which in turn reduces the failure ratio.
    Team # 26333 Page 52 of 53
    10 Strengths andWeaknesses
    10.1 Strengths
     Our models are fairly robust to the changes in parameters based on sensitivity
    analysis. It means a slight change in parameters will not cause a
    significant change in the result.
     Different types of vehicles are taken into consideration, and the mixing ratio
    is based on actual data. We consider the length of vehicles and different
    maximum speeds which makes the model closer to reality.
     We come up with various criteria to compare different situations. Hence
    an overall comparison can be made based on these criteria.
     Our models are capable of simulating the situation in real life. The results
    also agree with common sense and life experience.
     A refined model is established to consider the role of ramps, which is a
    bright spot of our model.
    10.2 Weaknesses
     Factors of human judgments may be over-simplified. In order to consider
    that a driver may randomly decelerate and not choose to overtake when
    possible, we simply defined a possibility respectively. Actual situation
    may be more complicated.
     Some of the parameters are based on semi-educated guess because few
    data are available. However, based on our sensitivity analysis, they will
    not make a great difference if slightly changed.
     We did not consider the prediction of each driver. In our model, drivers
    change their speed only based on the information of the previous time
    step. But in fact, they can make a prediction
    回复

    使用道具 举报

    4#
    无效楼层,该帖已经被删除

    2

    主题

    12

    听众

    136

    积分

    升级  18%

  • TA的每日心情
    开心
    2015-2-6 08:35
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    社区QQ达人

    回复

    使用道具 举报

    2

    主题

    12

    听众

    136

    积分

    升级  18%

  • TA的每日心情
    开心
    2015-2-6 08:35
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    社区QQ达人

    回复

    使用道具 举报

    2

    主题

    12

    听众

    136

    积分

    升级  18%

  • TA的每日心情
    开心
    2015-2-6 08:35
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    社区QQ达人

    回复

    使用道具 举报

    2

    主题

    12

    听众

    136

    积分

    升级  18%

  • TA的每日心情
    开心
    2015-2-6 08:35
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    社区QQ达人

    回复

    使用道具 举报

    2

    主题

    12

    听众

    136

    积分

    升级  18%

  • TA的每日心情
    开心
    2015-2-6 08:35
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    社区QQ达人

    回复

    使用道具 举报

    2

    主题

    12

    听众

    136

    积分

    升级  18%

  • TA的每日心情
    开心
    2015-2-6 08:35
  • 签到天数: 11 天

    [LV.3]偶尔看看II

    社区QQ达人

    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册地址

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2024-5-28 10:36 , Processed in 0.685083 second(s), 95 queries .

    回顶部