toreartist.blogg.se

Block world problem in prolog
Block world problem in prolog









block world problem in prolog

He can smuggle in bottles of whiskey of size 4 units, bottles of perfume of size 3 units, and cartons of cigarettes of size 2 units.

block world problem in prolog

invalido(dog,cat).Īnd my algorithm of search camino(Nodo,Nodo,). The Knapsack Problem A smuggler has a knapsack of 9 units. % Here I need any order but in list 3Īnd my restrictions are. As rearrangement goals are satisfied, changes will be.

#Block world problem in prolog how to

I have 3 places, the result of the "ordered" list should be in place 3, something like this: R = (previously there are all the changes you made to get to this). The rest of the program will involve rules for how to accomplish various tasks involving the blocks world. I am a beginner in programming with prolog, I had a question.įrom the block world in Bratko's book, I need to arrange the "blocks" DOG CAT RAT, I just can't put CAT with/over RAT or vice versa, and DOG with/over CAT, or vice versa, and I can only pass block by block, one by one. I can only take 1 animal at a time, but I can't leave the dog with the cat or the cat wit. I don't care about the order of list 3, , ], I care about the transition of animals between each list, so that they don't fight when I leave them alone. I will go on a trip and take my pets, I have 3 animals (dog, cat, rat), but they don't get along very well.

block world problem in prolog

an example of what I'm looking for is the following. I took Bratko's world of blocks, since each block I can interpret as 1 animal, and the 3 lists that the original problem raises I can see as, , ], it would only be necessary to add the rules that animals should not be together and that the goal ends in the third list. I can only take 1 animal at a time, but I can't leave the dog with the cat or the cat with the hamster alone because they would literally eat each other, I am looking for Prolog to find my result of valid transitions to get to my new house with my 3 animals. I will go on a trip and take my pets, I have 3 animals (dog, cat, rat), but they don't get along very well.











Block world problem in prolog