Coronavirus (Covid-19): Latest updates and information
Skip to main content Skip to navigation

Lab 9 More about EM tools and instruments

Having decided on the theme of your WEB-EM submission, it is a good idea to become as familiar as possible with the EM tools that you intend to use. (The term 'instrument' is mentioned prominently here to remind you that the aspiration in supporting EM is to develop development environments in which human agency is involved in somewhat like the way in which a musician plays an instrument. We are far from achieving this goal at present!) To some extent, it may be appropriate to consolidate on your understanding by revisiting previous labs. The directory /dcs/emp/empublic/teaching/ExampleModels includes several excellent examples of previous WEB-EM models. This lab also provides links to further resources, including labs from previous versions of CS405, that may be topical for your submission.

More about EDEN

You may well find it useful to exploit additional notations, such as the eddi notation for relational views and tables. Other features that may be of interest include:

  • The agent-oriented parser (AOP): This is a notation developed by Antony Harfield that makes it possible to implement new definitive notations within EDEN itself (and indeed to modify them on the fly). The eddi notation is one example of a notation implemented in this way. (For more details, see Lab 6 from 2006-7.)

The series of WEB-EDEN workshops relating to the theme of Sudoku solving is a useful introduction to many of the key themes and techniques introduced in the CS405 module. Versions of these workshops for use with desktop EDEN have been the subject of CS405 labs in previous years.

EDEN and JS-EDEN both support Empirical Modelling as a form of "modelling with definitive scripts". There is an interesting comparison between definitive scripts in EDEN, which are based on special-purpose definitive notations such as Donald, Scout and EDDI, and the scripts in JS-EDEN, in which observables are more closely associated with attributes of JavaScript objects. You can get a good perspective on some of the issues that arise when modelling with definitive scripts by reviewing the more 'advanced' features of EDEN, as set out here.

More about JS-EDEN

For the 2013 edition of the Rough Guide to JS-EDEN load the JS-EDEN presentation environment (e.g. by selecting the JSPE project from the Project List in the master variant of JS-EDEN), and enter include("models/cs405/RoughGuideJS-EDEN2013.js-e");

Where JS-EDEN is concerned, the prospects for exploiting the rich object models that can be created in JavaScript in model-building are as yet little explored. It is important to be aware that JavaScript variables are associated with contexts that are potentially helpful in organising JS-EDEN observables, but can also be a source of confusion. For instance, you should note that a JavaScript variable declared within a ${{ ... }}$ block as 'var x' or 'function f' in the EDEN Interpreter Window is not being declared in the global context, as it would be if the same JavaScript code were to be entered via the JavaScript console. If you want to make use of such variables in an interaction with JS-EDEN, you need to ensure that declaration of the variable and references to it are entered via the Input Window in the same block of code (this is is illustrated where the JavaScript variable cardDeck is processed in the 2013 edition of the JS-EDEN Rough Guide, slide 8). If you intend to declare global JavaScript variables from within the EDEN Input Window, their definition should not be preceded by a 'var' and 'function' annotation. A new function called declare_jse() has been introduced by Nick Pope to make it much simpler to link JavaScript variables to JS-EDEN observables in flexible ways. This function is specified and documented in the file http://jseden.dcs.warwick.ac.uk/master/library/declarevar.js-e and its use is illustrated in the associated testfile http://jseden.dcs.warwick.ac.uk/master/tests/testdeclare.js-e. (The introduction of testfiles of this nature is a good practice to follow when adding new functionality to the JS-EDEN interpreter.) The use of this function to add a cardDeck to JS-EDEN in a more persistent manner is also illustrated in the Rough Guide (see slide 9). For another example of its use, see the simple demonstration of HTML5 audio within JS-EDEN in the file:

http://jseden.dcs.warwick.ac.uk/master/models/testsound/audioHTML5test.js-e.

For more insight into how JavaScript structure and JS-EDEN structures can be linked, consult the source and the Model Readme of Hui Zhu's 'graph prototype' model. This forms part of Hui's exploratory research into modelling parsing states using definitive scripts which we expect to simplify the implementation of additional definitive notations in JS-EDEN in due course. The graph prototype replicates most of the functionality of the EDEN graph package introduced by Charlie Care that was deployed in making an EDEN version of the DMT in a previous lab. For instructions on loading the model, enter the command

include("models/graphPrototype/README.html");

via the EDEN Interpreter Window in JS-EDEN, and follow the instructions that you then find under the 'Model Readme' tab. Hui has also developed a tutorial that gives a step-by-step account of one way in which new notations can be added to JS-EDEN - this is the subject of Lab 10.