当前位置: 首页 > news >正文

网站开发有哪几种语言php 网站开发工程师

网站开发有哪几种语言,php 网站开发工程师,网络卖货平台有哪些,邯郸网站建设市场1. 上手 1.1 快速使用 首先是简单的调用测试,在mac上首先安装clp的库:brew install coin-or-tools/coinor/cbc,然后新建项目进行调用,各项配置如下,注意要添加的library和directory比较多: 1.2 命令行方…

1. 上手

1.1 快速使用

首先是简单的调用测试,在mac上首先安装clp的库:brew install coin-or-tools/coinor/cbc,然后新建项目进行调用,各项配置如下,注意要添加的library和directory比较多:
在这里插入图片描述

1.2 命令行方式

安装完cbc后,可以直接输入cbc调出命令行:
在这里插入图片描述
或者直接一行调用:

cbc air03.lp solve solu sol.txt

求解的几个配置:
Sec :默认Infinity,最多允许的执行时间
MaxN: 默认Infinity : 最多允许搜索的节点数。防止内存溢出
MaxS : 默认Infinity : 做多允许存储的可行解数量。如果只想要一个可行解,可以把这个数值设置为1.

2. 基本调用方法

标识类名说明
ACbcBranch…MIP的非连续类,比如说整数变量、0-1变量
BCbcNode接下来进行branch的节点
CCbcTreeCbcNode的集合
DCbcCompare…在CbcTree上决定下一步探索那个Node的函数,可以修改
ECglCutGeneratorsCGL中的cut generator,很少有人自己写
FCbcHeuristics启发式算法

2.1 model和solver

需要首先定义一个线性规划的solver,传入model中。
model的方法和solver的方法很多是一致的,比如model.getNumCols() 以及model.solver()->getNumCols(),但是同步性有时会有差别,比如getColSolution() ,CbcModel可能不是最新的结果,这时可以用CbcModel::bestSolution()来获取结果。
当然两者还是有差别的,比如用来减少输出显示的代码:

model.solver()->setHintParam(OsiDoReducePrint,true,OsiHintTry);

在model中就没有。

2.2 获取结果信息

在这里插入图片描述

2.3 预处理和cut选项

  • Prep : 预处理,默认sos
    sos: creates Special Ordered Sets [CITE] to improve branching
    off: turns of pre-processing
    equal : turns ≤ clique constraints into equality clique constraints

  • PassP : 默认5

  • Cuts : 默认On

  • Clique : 默认IfMove
    Off : never try this cut;
    Root : cuts applied only at root node;
    IfMove : cuts will be used of they succeed on improving the dual bound;
    ForceOn : forces the use of the cut generator at every node.

  • Lift(liftAndProjectCuts) : 默认Off

  • Mixed(MixedIntegerRounding) : 默认IfMove

  • Two(TwoMirCuts) : 默认Root : Determines the application Two phase Mixed Integer Rounding cuts.

  • Knapsack : 默认IfMove

  • Flow : 默认IfMove

  • Probing(ResidualCapacityCuts) : 默认forceOnStrong
    除了上述选项外,还包含:forceOn, forceOnGlobal, forceOnStrong, forceOnButStrong and strongRoot.

  • Residual(ResidualCapacityCuts) : 默认Off

  • CutD(CutDepth): 默认-1
    当深度为CutD的倍数时进行cut。CutD=-1时,由cbc来自动判断。

  • CutL(CutLength): 默认-1
    gomory cuts允许的最大cut数目。默认情况由cbc决定:
    0 ≤ CutL < 10, 000, 000 : maximum length of CutL for cuts generated at root node and in the tree;
    CutL ≥ 10, 000, 000 : allows cuts with unlimited length at root node, with a limit inside the tree. for example: CutL =10,000,130 indicate that in the tree only cuts with at most 130 variables will be accepted.

  • PassC(PassCuts) : 默认-1
    根节点cut passes最大数目。如果是 -1, 使用以下策略,其中n是变量数(column number):
    n ≤ 500 : 100 passes;
    500 < n ≤ 5000 : 100 passes, stopping when bound improvements are small;
    n ≥ 5000 : 20 passes for larger problems.

2.4 启发式算法

  • Round:在每次搜索时启用rounding heuristic
  • Feas : 在根节点启动feasibility pump heuristic。使用一系列LPs,尝试获取integer feasible solution.
  • PassF(PassFeasibilityPump): 默认30。Feasibility Pump heuristic的最大允许pass数目。若没有获得初始可行解,可以尝试将数值提升。
  • Local(LocalTreeSearch):默认off
  • PivotAndC( PivotAndComplement):默认Off
  • PivotAndF(PivotAndFix):默认Off
  • Combine : 默认On
    在多次求解之后,仅尝试对出现过多次的变量进行b&c
  • Combine2 : 默认Off
    比上面的要求更严格,要求出现多次且数值相同。
  • Rins : 默认On
    控制Relaxation Induced Neighborhood Search heuristic.
  • Rens : 默认Off
    控制Relaxation Enforced Neighborhood Search heuristic.
  • Vnd(VndVariableNeighborhoodSearch):默认Off
    控制Variable Neighborhood Search heuristic.
  • DivingG(DivingGuided) : 默认Off.
    切换为Guided Dives heuristic
  • DivingP(DivingPseudoCost): 默认Off.
    切换为使用pseudo costs的Diving heuristic .
  • DivingF(DivingFractional): 默认Off.
    切换为Diving Fractional heuristic.
  • DivingS(DivingSome): 默认Off.
    切换为random diving heuristic at various times.

此外,cbc只有一个rounding heuristic,可以自定义启发式算法。

3. 选择下一个搜索节点

使用CbcCompare来控制如何选择搜索节点。已经定义好的实现如下

类型描述
CbcCompareDepth一直探索最深的树节点
CbcCompareObjective一直探索当前目标函数最佳的树节点
CbcCompareDefault在可行解找到前使用depth-first。当一定数量的nodes被探索过、或者一定数量的解被发现后,改用breadth-first搜索;然后当树到达一定的尺寸后,再改为depth-first
CbcCompareEstimate当pseudo cost启用时,可以用来猜测解

要自己实现的话,参考使用下面的函数:
在这里插入图片描述
修改CbcCompareUser.hpp和CbcCompareUser.cpp中CbcCompare的bool test(CbcNode* x, CbcNode* y)) 函数:当node y优先于node x,返回true。
CbcCompareUser::test()方法代码如下:

// Returns true if y better than x
bool
CbcCompareUser::test (CbcNode * x, CbcNode * y)
{if (weight_==-1.0) {// before solutionif (x->numberUnsatisfied() > y->numberUnsatisfied())return true;else if (x->numberUnsatisfied() < y->numberUnsatisfied())return false;elsereturn x->depth() < y->depth();} else {// after solution.// note: if weight_=0, comparison is based//       solely on objective valuedouble weight = CoinMax(weight_,0.0);return x->objectiveValue()+ weight*x->numberUnsatisfied() >y->objectiveValue() + weight*y->numberUnsatisfied();}
}

tree是无状态的。newSolution()方法在每次新的解发现时调用,另外每1000次探索后调用every1000Nodes(),此时可以修改test()中的变量(e.g., weight_).同时由于CbcNode有model指针,因此同时可以修改诸如最大允许时间等变量 (e.g., CbcModel::setMaximumSeconds(double value))

3. 示例文件说明

在这里插入图片描述

http://www.yayakq.cn/news/385744/

相关文章:

  • 汕头做网站公司哪家好淘宝网站怎么做的好看
  • 广东建设局网站首页wordpress d8 3.0
  • 做网站的排名学信网查学历
  • 网站建设图片怎么切百度问一问付费咨询
  • 企业网站seo托管怎么做在线小公司网站制作
  • 大型网站建设机构哪家好莱芜搜狗推广咨询
  • 北京网站定制设计开发公司建立网站一般要多少钱
  • 黄页网站大全免费在哪买网站空间
  • 在重庆 那里可以做诚信网站认证营销型网站建设+课程
  • 无锡网络公司无锡网站制作网站栏目合理性
  • 网站服务器配置参考指南建筑管理招聘网
  • 网站高级感推广之家app下载
  • 太康做网站公司360网站推广官网网址
  • 广州文化网站模板网站开发提供源代码
  • 网站能为智慧城市建设作出什么贡献北京建站公司
  • 怎么做跨境电商网站无锡微信网站推广
  • 网站建设那个公司好珠海新闻头条最新消息
  • 公司网站开发部署怎么将网站做成公司官网
  • 做爰全过程免费费网站邮票上的化学史网站开发
  • 网站建设网站嗨建站
  • 在学做网站还不知道买什么好深圳龙岗医院
  • 茌平网站建设费用excel做公司的小网站
  • 新乡网站建设哪家公司好备案 添加网站
  • 网站内容多 询盘淘宝官网首页登录电脑版
  • 新网站怎么运营影评网站怎么做
  • 深圳有做网站的公司吗wordpress搭电影网站
  • 揭阳高端网站建设价格wordpress修改首页模板文件名
  • 网站 app 共同架构乔拓云智能建站系统官网
  • 苏州网站建设狮山路wordpress 搬家 空白
  • 渭南免费做网站如何建设提卡网站