newscriptvar_no=178;
/* slide html pages */
execute("slide1 is "//pres_parsehtml("<h1>A brief tutorial on Empirical Modelling (EM)</h1>
<p>These presentation slides enable you to explore Empirical Modelling concepts with reference to a simple DoNaLD script. They were originally created by Shao Jin Ai in connection with WEB-EM-3 in 2007-8, and have here been adapted for lab use.</p>

<p>The illustrative model used is a floorplan of a room made with the line-drawing definitive notation DoNaLD (a <i>definitive notation</i> is a simple formal language in which to express definitions). This was originally devised by Edward Yung in his MSc-by-research dissertation in 1989. The room has a desk, coffee table and lamp. The model is very flexible and can be indefinitely extended by interactively redefining the observables. Within the model the semantics of the real objects is represented through dependencies. For example the lamp will stay in the centre of the table if the table is moved and will remain plugged into the socket.</p>

<p>&nbsp;

<p>The room model has been placed in the left-hand window. To display this, press the \"Expand\" button.</p>")//";");
execute("slide2 is "//pres_parsehtml("<h3>What is Empirical Modelling</h3>

<p>Empirical Modelling establishes a \"moment-by-moment\" correlation between the experience offered by the computer and some external experience. Modelling activity is thus (as if) carried out in a situation in which there is a referent. 'Models' and 'referents' in a more traditional sense only emerge from patterns of interaction and interpretation that become ritualised in character.</p>

<p>For the room model, a real or imagined room represents the referent. The model is somewhat like a personal mental model that is expressed using the computer, and is referred to as \"a construal\".</p>


<p>&nbsp;")//";");
execute("slide3 is "//pres_parsehtml("<p>Observables, dependencies and agency are the three key elements of EM. </p>

<ul>
<li><b>Observables</b> are 'entities with an identity and status'. The observables in the room model include everthing that you can see, such as the door, table, lamp etc. together with their attributes.<br>&nbsp;</li>

<li>A <b>dependency</b> is a relationship between observables such that changing the value of one observable affects the values of other observables in a predictable way as if in one indivisible action. Dependency in the room model will be illustrated in the following slides.<br>&nbsp; </li>

<li>An <b>agent</b> is something that can change the state of the model in some way by manipulating observables and the relationships between them. In the primary and most primitive form of Empirical Modelling, such as is illustrated in the room model here, the modeller is the only state-changing agent, though they may act in the role of different agents: e.g. room user or designer, architect, Empirical Modelling lecturer.</li>

</ul>")//";");
execute("slide17 is "//pres_parsehtml("<p>
The room construal is defined by a set of definitions: <i>a definitive script</i>.
The script includes points to represent the corners of room, and lines to represent the walls of the room. The positions of all the other 3 corners of the room are dependent on the South-West corner. There is a door, a desk, a table in the room, and, in addition, a lamp on the table and a drawer in the desk.
</p>
<p>
Here is the extract from the definitive script that defines the door:
</p>
<script>%donald
openshape door
within door {
  boolean open
  int width
  line door
  point lock, hinge
}

within door {
  open = true
  width = 200
  door = [hinge, lock]
  lock = hinge + (if open then {0, -width} else {width, 0})
  hinge = ~/NW + {15, -10}
}</script>
")//";");
execute("slide18 is "//pres_parsehtml("<h3>Exploring the room construal</h3>
<p>
The script defines the state of the room construal <i>as of now</i> - cf. the 'state-as-experienced'. The 'state' can be construed in many ways, according to who is observing it, and why. The script can be freely redefined via the Input Box, hence its openness to interaction and reinterpretation.
</p>

<p>There are many ways in which you can explore the observables in a model. For instance: you can inspect the screen display and speculate on the possible interpretations of the features you see; you can think about any relevant domains to which the display might refer (in this example potentially properties of interest to an architect or room user); you can inspect the contents of the script; you can interrogate observables in the model. (For more about interrogating observables, see the Footnote on the last slide.) 
</p>")//";");
execute("slide7 is "//pres_parsehtml("<p>The following slides illustrate re-definitions that can serve to assess the plausibility of the computer artefact as a model of a room. They explain and illustrate different observables in the room and expose their dependencies.</p>
<i>Door</i>

<p>The hinge position of door is dependent on the north-west corner of the room. If the door is open, the coordinates of the lock are the coordinates of hinge plus {0, -width}. If the door is closed, the coordinates of the lock are the coordinates of hinge plus {width,0}.</p>

<p>hinge and lock are two points in the model. To see where they are, execute the following script:</p>
<script>%donald
within door{
	circle hhinge, hlock
	hhinge = circle (hinge, 10)
	hlock = circle(lock,10)
}    # highlight the hinge and lock points</script>
")//";");
execute("slide8 is "//pres_parsehtml("<p>If you relocate the SW corner of the room, the door moves together with the room:</p>
<script>%donald
SW = {50,200}	# move corner of the room</script>
<script>%donald
SW = {100,100}  # move back</script>
<p>To shut and open the door:</p>
<script>%donald
door/open = false # shut the door</script>
<script>%donald
door/open = true  # open the door</script>
")//";");
execute("slide9 is "//pres_parsehtml("<i>Table</i>

<p>The table is also composed of four corners and four sides. The South-West of the table is placed at the centre of the room. The other three corners of the table are positioned relative to the SW corner. The table position is initially defined relative to the room, but cn be redefined so that it moves only if you change the position of its SW corner:</p>
<script>%donald
within table {
	SW = {500,300}		# moving the table
}</script>
<p>There is a lamp on the table. The centre of the lamp is located as the midpoint of the SW and NE corners of the table. The table corners are loosely defined, and it is easy to set up some nonsense situtation: </p>
<script>%donald
table/NE = {900,100}</script>
")//";");
execute("slide10 is "//pres_parsehtml("<p>The following definitions seem to restore the table to normality</p>
<script>%donald
within table {
	NE = {800,900}		
	SW = {500,600}
}</script>
... though of course they fail to restore the original dependencies, for which the dependency of <code>table/NE</code> on <code>table/SW</code> must be reintroduced:
<script>%donald
within table {
	NE = SW + {width,length}
}</script>
<p>We could move the lamp but not the table through redefining the coordinates of the lamp centre so that it does not depend on the table:</p>
<script>%donald
table/lamp/centre = {600,800}</script>
")//";");
execute("slide11 is "//pres_parsehtml("<i>Two plug sockets</i>

<p>There are two plug sockets in the room: one is at the middle of the south wall, the other at the middle of the east wall. The cable of the lamp is from the centre of the lamp to 'plug', which can be construed as referencing the plug on the lamp cable.</p>

<p>In the script, the sockets into which the lamp can be plugged are referred to as <code>plug1</code> and <code>plug2</code>. Renaming the observables <code>plug1</code> and <code>plug2</code> to something more appropriate:</p>
<script>%donald
point socket1, socket2
socket2 = plug2			
socket1 = plug1</script>
<p>To change the socket being used for cable:</p>
<script>%donald
point plug
plug = socket2</script>
")//";");
execute("slide12 is "//pres_parsehtml("<i>Desk</i>

<p>The desk is composed of four corners and four edges, and is positioned relative to the room's SW corner. The desk has a drawer. Redefinitions serve to change the size and position of the desk. Note the dependency of the drawer size on the desk:</p>
<script>%donald
desk/length=250 # was originally 350</script>
<p>or</p>
<script>%donald
desk/SW = SW + {100,100}</script>
")//";");
execute("slide13 is "//pres_parsehtml("<p>There is an integer parameter that describes the condition of the drawer. 1 represents closed, a larger value of k represents more open. The 'length of the drawer' - or in fact length of the protruding part of the drawer - equals the desk width minus the desk width divided by k.</p>
<script>%donald
within desk{
  within drawer{
    k=8
  }
}</script>
<script>%donald
desk/drawer/k=2</script>
")//";");
execute("slide14 is "//pres_parsehtml("<p>The previous slide is not a very good way of moving the drawer. The following script makes a better model of the opening and shutting of the desk drawer. </p>
<script>%donald
within desk {
  within drawer {
    real howopen
    E = [NE, SE]
    W = [NW, SW]
    S = [SW, SE]
    N = [NW, NE]
    SE = SW + {length, 0}
    SW = NW - {0, width}
    NE = NW + {length, 0}
    NW = (~/NE  * howopen + ~/NW * (1-howopen))
    length = ~/width
    width = ~/length div 3
   }
}</script>
<p>Try the following to see what happens:</p>
<script>%donald
desk/drawer/howopen=0.3</script>
")//";");
execute("slide15 is "//pres_parsehtml("<h3>Things to try doing</h3>

<p>We can change the door to a sliding door:</p>
<script>%donald
within door{ 
	point doorleft, doorright
	door = [doorleft, doorright]
	doorleft = ~/NW + {15, -10} + (if open then {width, 0} else {0,0})
	doorright = doorleft + {width,0}
}</script>
At this point, the circles highlighting the hinge and lock points of the door are no longer appropriate and can be deleted:
<script>%donald
within door {
	delete hhinge
	delete hlock
}</script>
")//";");
execute("slide16 is "//pres_parsehtml("<p>Imagine a little more intelligent room. We can arrange for the lamp to appear to be on when the door is open, and off when it is closed:</p>
<script>%donald
within table{
      within lamp{
                circle bulb
                bulb = circle(centre, size div 5)
        }
}
%eden
A_table_lamp_bulb is \"fill=solid,color=\" // ((_door_open) ? \"yellow\" : \"black\");</script>
The observable <code>A_table_lamp_bulb</code> refers to the attributes of the Donald observable <code>table/lamp/bulb</code>.
<p>To shut and open the door:</p>
<script>%donald
door/open = false # shut the door</script>
<script>%donald
door/open = true  # open the door</script>
")//";");
execute("slide19 is "//pres_parsehtml("<h3>Footnote</h3>
<p>This presentation is supported by the EDEN interpreter. EDEN is an 'evaluator for definitive notations'. The environment for this presentation is itself described by a script of definitions in the definitive notation <code>%angel</code>. Whichever definitive notation is used to define an observable, its actual representation is translated into and stored internally in the underlying Eden notation. To interrogate the DoNaLD observable <code>table/SW</code> in the script you can type a query of the following form:</p>
<script>%eden
?_table_SW;</script>
<p>You can also type:</p>
<script>writeln(_table_SW);</script>
<p>To see the response to such queries you must consult the EDEN output window (which can be done by using the 'Show tkeden' button). Note the list of observable names that appear after the '~>' in the response to a '?' query: this is the list of observables whose values are defined directly in terms of the queried observable. </p>")//";");
pres_slidecount=19;
pres_slides=["slide1","slide2","slide3","slide17","slide18","slide7","slide8","slide9","slide10","slide11","slide12","slide13","slide14","slide15","slide16","slide19"];
pres_currentslideno=16;
