Toggle navigation
?
users online
Logout
Open hangout
Open chat for current file
% Supply Route Definition sup(X,Y,Z) :- % X supplies Y with Z imp(Y,Z), % if Y imports Z exp(X,Z), % if X exports Z act(X), % if X is active format("~w ~t:~t ~w ==> ~w ~n", [Z, X, Y]). % print supply routes % Active Sites act(X) :- forall(imp(X,Y),sup(_,X,Y)). % Site X actively producing if all imports are supplied % this rule is useful for queries % act("Build Depot") will print the supply lines to Build Depot % Imports imp("Build Depot", "Concrete"). imp("Build Depot", "Sand"). imp("Build Depot", "Wood Planks 14ft"). imp("Build Depot", "H-Beam 6m"). imp("Build Depot", "Plastic Pipes 6m"). imp("Super Market", "Rice"). imp("Super Market", "Pumpkin"). imp("Super Market", "Cabbage"). imp("Super Market", "Potato"). imp("Super Market", "Corn"). imp("Super Market", "Orange"). imp("Super Market", "Bean"). imp("Super Market", "Cheese"). imp("Super Market", "Meat"). imp("Cheese Factory","Milk"). imp("Meat Factory","Container"). imp("Concrete Factory", "Sand"). imp("Concrete Factory", "Cement"). imp("Concrete Factory", "Fuel"). imp("Plastic Factory", "Container"). imp("Plastic Factory", "Oil"). imp("Lumbermil", "Log 20ft"). imp("Lumbermil", "Oak Log 12ft"). imp("Sanho Oil", "Crude"). imp("Cement Factory", "Limestone"). imp("Steel Mill", "Coal"). imp("Steel Mill", "Iron Ore"). imp("Steel Mill", "Limestone"). % Exports exp("Sanho Oil", "Fuel"). exp("Sanho Oil", "Oil"). exp("Concrete Factory", "Concrete"). exp("Oji Drilling", "Crude"). exp("Farm", "Rice"). exp("Farm", "Pumpkin"). exp("Farm", "Cabbage"). exp("Farm", "Potato"). exp("Farm", "Corn"). exp("Farm", "Orange"). exp("Farm", "Bean"). exp("Farm", "Milk"). exp("Imports", "Container"). exp("Meat Factory", "Meat"). exp("Cheese Factory", "Cheese"). exp("Forest", "Log 20ft"). exp("Forest", "Oak Log 12ft"). exp("Plastic Factory", "Plastic Pipes 6m"). exp("Construction", "Sand"). exp("Lumbermil", "Wood Planks 14ft"). exp("Steel Mill", "Steel Coil"). exp("Steel Mill", "H-Beam 6m"). exp("Dasa Harbour", "Iron Ore"). exp("Dasa Harbour", "Coal"). exp("Quarry", "Limestone"). exp("Cement Factory", "Cement").