Definitions which can be entered into the system are inred
Find a sequence of filling, emptying and pouring from one jug into the other until the target of 1 unit is reached in either jug. (a solution is at the bottom of the page)
viscosity is a variable which controls the speed of the filling and emptying. In the input window select the%eden radio button and enter ?viscosity;
then click on the Accept button find out the current value (which will be displayed in an output window).
Try changing it by typing inviscosity=<number>; in the input window and clicking on Accept.
In the input window type target=2;
Which of the following quantities is it possible to get and how many steps can it be done in?
In the input window change the capacity by typingcapA =8; capB =6; you will see the images representing the jugs change immediately. Try the same exercise as in investigation 1. (Can also try setting capacities to 9 and 3.)
A solution to investigation 1:
FillA, Pour, FillA, Pour, emptyB, Pour, FillA, Pour
Definitions which can be entered into the system are inred. This follows on from 5 minute tour and involves experimenting with changing variables and definitions.
One of the benefits of Empirical Modelling is immediate processing and updating. The first exercise in this tour is to experiment with changing the values of some of the variables and the second is to change some of the definitions.
For the following variables try querying their current values by selecting the%eden radio button in the input window and enter a question mark followed by the name, as in the example below.
Then click on Accept and look at the output window for the results of the query. You can change the values by typing in a new value in the input window, eg:
viscosity – how fast the jugs can be filled and emptied
capA,capB – the capacity of the jugs
contentA,contentB - current content of liquid, (a quick way to cheat is setting content to 1 or target!)
target - the target, success message is printed if contentA or contentB == target
widthA, widthB – the width of the jugs (the way the graphics have been written is not ideal in this case, as you can see if you change the width of only one jug)
It might be better if the jugs were always the same width. One way to do this is give widthB the value of widthA. If you typewidthB = widthA; that would work when you first input it but then if you subsequently change widthA, widthB would retain its previous value.
If you inputwidthB is widthA; however, widthB will always change when you change widthA.
Afull and Bfull are boolean variables which are true when the jugs are full. When you fill jug A it will stop filling when Afull is true. Afull is currently defined as follows:
Afull is capA==contentA;
Try to redefine this definition so that Afull is true when there the jug is one unit of liquid short of its maximum capacity.
Currently the capacity (capA,capB) is defined to be a constant value, but you can redefine it so that it is dependent on the content of the jug.
Work out the definition needed so that the capacity of the jug B grows as it is filled up, and is always one more than the content. (you can stop it going on indefinitely by typingBfull=1;)
Try changing some of the other definitions:
The visuals in this model are clearly very simple, mostly text. The definition for the Jug representations are given below.
JugA is repeatChar('|', 2*capA+2+widthA);
JugB is repeatChar('|', 2*capB+2+widthB);
The positions of the elements on screen are relative to a base position, given below.
The c and r stand for rows and columns (of text characters).base is 15 columns and 20 rows from the top left corner. If you want to change base you must first select %scout because this point was defined in scout.
Another definition isfinish is ((contentA==target)||(contentB==target))&&!updating;
A useful feature of the environment is that all the current definitions can be viewed. To do this you selectView Eden definitions from the View menu and then click on Select All.