运筹优化学习01:Lingo入门与错误列表分析(二)

简介: 运筹优化学习01:Lingo入门与错误列表分析

4 常见错误分析

4.1 错误代码29:数组初始化个数与指定数目不一致

若提供的数据数目与集合段指定的数据长度不一致,会报如下错误:

20190605224903364.png

意思是说:B变量初始化的个数少于集合段指定的数目;点击Explain按钮可以查询更详细的问题解释


You must assign a value to every element of each array in a DATA or INIT statement. LINGO keeps track of the number of values you specified and checks this against the length of each array being assigned. If the two numbers don’t agree, LINGO prints this message along with the number of values that are required.


4.2 错误代码12:缺少右括号报错

20190605225947605.png


意思是:这样代码缺了一个右括号


A LINGO expression is missing at least one closing right parenthesis. LINGO will point to the end of the expression where the error occurred. Count the number of parentheses in this expression to verify if you have input the correct number, or, in Window use the Edit|Match Parenthesis command to find the unmatched parenthesis.


4.3 错误代码11:无效的输入,语法错误

模型的【model】关键字没有加【:】


2019060523295383.png

This is the generic error issued by the LINGO compiler when it detects a syntax error. In Windows, when you close the error box, the cursor will be on the line where the error occurred. Other versions of LINGO will try print out the general area where the error has occurred, but LINGO cannot always pinpoint the exact line. Examine this area for any obvious syntax errors. If you are unable to find any obvious errors, a useful technique is to comment out small sections of the model until the error goes away. This should give you a good idea of exactly where the error is occurring.


Syntax errors may also occur if you are not invoking the correct compiler in LINGO.  Most users will choose to build models using the native LINGO syntax, however, some users may prefer building their models using LINDO syntax.  LINGO can compile models written in either native LINGO syntax or LINDO syntax.  LINGO chooses the compiler based on a model's file extension.  LINGO models must have an extension of lg4 (the default) or lng. LINDO models must have an ltx extension. The default model extension may be set by clicking on: LINGO | Options | Interface | File Format.  Each model window's title bar displays whether it is a LINGO or LINDO model.


5 LINGO的错误列表

LINGO出错时错误代码含义:

  在LINGO程序求解时,系统首先会对程序进行编译.系统在编译或执行其他命令时,会因程序中的错误或运行错误,弹出一个出错报告窗口,显示其错误代码,并简要指出错误的原因.这些错误报告信息能够提示用户发现程序中的错误,以便能尽快修改.下面我们给出出错信息的一个简要说明,仅供参考.

LINGO错误编号及原因对照表

image.png

image.png

image.png

image.png

image.png

image.png

image.png


相关文章
|
Dubbo Java 应用服务中间件
深入Dubbo异步化:探索AsyncContext的神奇之处
深入Dubbo异步化:探索AsyncContext的神奇之处
519 0
|
6月前
|
数据可视化 搜索推荐 大数据
2026版基于python大数据的旅游可视化及推荐系统
本研究聚焦基于Python大数据的旅游可视化与推荐系统,利用Python在数据处理、分析和可视化方面的优势,结合Django框架与MySQL数据库,构建高效、个性化的旅游推荐平台。通过爬取多源旅游数据,运用机器学习算法挖掘用户偏好,实现精准推荐;借助Matplotlib、Seaborn等工具进行数据可视化,直观展示景点分布、客流趋势等信息。系统不仅提升游客决策效率与体验,也助力旅游企业优化产品设计与营销策略,推动行业数字化转型与智能化发展。
|
9月前
|
机器学习/深度学习 自然语言处理 运维
“日志别再只会翻了,教它自己说话”——聊聊用 NLP 玩转日志分析
“日志别再只会翻了,教它自己说话”——聊聊用 NLP 玩转日志分析
671 0
|
机器人 C++ Python
ROS2教程 02 功能包
本文是关于ROS2(机器人操作系统2)中功能包(package)管理的教程,介绍了如何检查功能包的依赖、创建新功能包、列出可执行文件、列出所有功能包、查询功能包的位置和描述信息,以及为C++和Python功能包配置必要的文件。
864 0
|
Linux C# Android开发
.NET Avalonia开源、免费的桌面UI库 - SukiUI
.NET Avalonia开源、免费的桌面UI库 - SukiUI
1102 5
|
关系型数据库 MySQL Windows
mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法
本文讲解:mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法
|
算法 Java C++
branch and price求解VRPTW问题代码详解
branch and price求解VRPTW问题代码详解
1032 0
branch and price求解VRPTW问题代码详解
|
SQL IDE Java
通过一次性能优化,再次记牢了mybatisplus的QueryWrapper、LambdaQueryWrapper、AbstractWrapper这三者之间的关系...
本文描述了一次针对SpringBoot应用中MyBatisPlus分页查询的性能优化过程。在优化时,作者重写了BaseMapper的`selectPage`方法,通过`Wrapper`的`between`操作添加了ID区间限制以提升SQL执行效率。然而,由于在业务服务类中循环调用分页查询时未每次都创建新的`Wrapper`对象,导致`id BETWEEN ? AND ?`条件重复出现在SQL中。那么,如何解决这个问题呢?
1642 5
|
数据采集 机器学习/深度学习 Python
掌握XGBoost:特征工程与数据预处理
掌握XGBoost:特征工程与数据预处理
1185 3
|
人工智能 自然语言处理 语音技术
pull错代码,恢复到pull之前 ---本地代码回退
pull错代码,恢复到pull之前 ---本地代码回退
635 0