農夫が畑に小麦あるいはとうもろこしを植えるかを選択します。...
移動
次へ 前へ
上へ 最上
参考
工場での作業スケジューリングその1
工場作業スケジューリングその2
農地管理
スミス氏パズル
投資計画
プロジェクト計画
Send More Money
イフコンピュータ > IF/Prolog > 制約処理パッケージ > 例題プログラム > 農地管理

農地管理

MINERVA superseeded IF/Prolog. Please see http://www.ifcomputer.co.jp/MINERVA for details.

We discontinued to sell IF/Prolog Dec 31. 2003. For current customers, we continue to provide professional support for IF/Prolog until Dec 31, 2008.

農夫が畑に小麦あるいはとうもろこしを植えるかを選択します。 小麦ととうもろこしでは、1ヘクタール当たりの収穫量が異なります。 また、その栽培にかかる時間も異なります。農夫が働くことができる 最大日数は決められています。このような制約下で、労働時間40日間、 農地100ヘクタールの場合の最大収穫量を計算しなさい。

:- import(const_linear).

farm(Area, WorkTime, AreaCorn, AreaWheat, Yield) :- corn(OutputCorn, CostsCorn), wheat(OutputWheat, CostsWheat), all_positive([AreaCorn, AreaWheat]), Area $>= AreaCorn + AreaWheat, WorkTime $>= CostsCorn * AreaCorn + CostsWheat * AreaWheat, linear_maximize(AreaCorn * OutputCorn + AreaWheat * OutputWheat, Yield). corn(0r5/2, 0r1/3). wheat(0r7/2, 0r2/3).

[user] ?- farm(100,40,AreaCorn,AreaWheat,Yield). AreaCorn = 80 AreaWheat = 20 Yield = 270 yes

続く..
IF/Prolog by Siemens
言語
English
Japanese
German
サーバー
USA
Japan
サイトマップ
索引
目次
全体目次
全体索引
印刷向き
imode
PDA
探索
document: http://www.ifcomputer.co.jp/IFProlog/Constraints/ExamplePrograms/FarmlandManagement/home_jp.html
published 2008/5/12 update 1996/12/10 (c) 1996-2006 IF Computer Japan
IF Computer 〒113-0022 Tel 03-5814-3352 ifcj@ifcomputer.co.jp
Customer Support 東京都文京区千駄木5-28-2   http://www.ifcomputer.co.jp
冒頭へ managed with ubiCMS