A farmer can choose to grow wheat or corn in his ...
Move to
Next Prev
Up Top
See also
Job-Shop Scheduling I
Job-Shop Scheduling II
Farmland Management
Smith Puzzle
Portfolio Management
Project Planning
Send More Money
IF Computer > IF/Prolog > Constraint Technology Package > Example Programs > Farmland Management

Farmland Management

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.

A farmer can choose to grow wheat or corn in his fields, each crop produces a different yield per hectare but also requires a different amount of time for its care. There is a limit to the maximum number of working days the farmer has available for these crops. The following IF/Prolog program calculates the maximum yield achievable from his 100 hectares and 40 working days. The yield of wheat pro acre is 2.5, while that of corn is 3.5. The time necessary for cultivating wheat compared with that for corn is 1:2.

:-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

read on...
IF/Prolog by Siemens
Language
English
Japanese
German
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/IFProlog/Constraints/ExamplePrograms/FarmlandManagement/home_en.html
published 2008/5/12 update 1996/12/10 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS