MOREA: A Knowlegdge based Multilevel Architecture for Hydrological System Simulation E. Guzmán A. Díaz R. Conejo Languages and Computational Science Department University of Málaga Complejo Tecnológico, Campus de Teatinos 29071 Tel.:+ 34 952 13 28 63 Fax:+ 34 952 13 13 97 Málaga, Spain e-mail: fguzman, adiaz, conejog@iaia.lcc.uma.es Keywords: knowledge representation, cognitive programming, programming for nonprogrammers, hydrology. ABSTRACT. Nowadays, hydrological information automatic systems provide amounts of information. This information cannot be processed by hand. In this paper we show a visual tool called MOREA (Artificial Reality Model), which allows us to build hydrologic basin representation models, in order to be simulated. Results analysis and visualization will be easier to the operators. MOREA let us to emulate the hydrologic basin behavior by the application of the models designed and calibrated by the knowlegge ingenieer. 1 INTRODUCTION The tool described in this paper is a result of a researching proyect called ARQUIMEDES (Model-based Intelligent Architectures for Real-time Information Systems data evaluation). The goal of this project is to develop a visual tool to build, calibrate and execute models, as well as data validation. MOREA (Artificial Reality Model) is a tool to build, calibrate and execute models. Using the knowledge-based pieces of a tool with a visual interface, strategic operator can build a simbolic scheme which represents an hydrological basin. In other way, MOREA lets a whole and comparative data analysis, which are the models simulation result. For a long time, intelligence artificial has been looking for a knowlegde representation mechanism, in order to represent any kind of knowledge. Even though some tasks could be built by this universal knowledge representations, there are some problems which should be solved in higher abstraction levels. Regardless implementation details, we are looking for a solution to this problem, in the side of the the knowledge involved and system behaviour. It is, anyway, a knowledge level system description following the suggestions of Newell [Newell82]. CYRAH [Garrote, 90] and SIRAH [Alonso, 93] systems, which were the beginning of KSM [Cuena, 94] methodology, are examples that use these knowledge representation mechanisms in hydrology. In this work, we purpose an hydrological knowledge structuration in two levels. The first one, in a higher abstraction level, where we define the basic pieces or bricks, that are going to be used in the following level. In the second level, those pieces will be used in order to define hydrological basin schemes. Basin physical elements behavior
Figura 1: System Architecture. will be emulated and predicted by the hydrological models application. As a result, all the knowlegde about hydrological systems physical members can be represented by this knowledge pieces. 2 SYSTEM ARCHITECTURE The following modules are part of the system architecture (figure 1): behavior models, models management interface, hypothesis coherence maintenance system (SMACH), generic configuration model, domain representation model, and model construction and operation interfaces. Behavior models are hydrology domain methods. These models, external to the operators and the knowledge ingenieer, are used in order to model an hydrological basin physical elements behavior. They could be implemented in an extern way, and later included in the system by models management interface, or internally using basic artihmetic operations by an specific purpose language called COVALTO. Also, this architecture is able to represent simultaneously more than one situations which could happen in a basin, without different simulations. For instance, it is possible to model, at the same time, different situations like open and close sluices of a dam. All of these situations will be called hypothesis. The enviroment has a module called SMACH (hypothesis coherence maintenance system), which allows us to maintain the coherence among formulated hypothesis. Knowledge ingenieer designs the generic configuration model. It contains cognitive units and methods that can be used to build domain representation models. With a generic configuration model, the strategic operator, using the model construction interface, could define easily, a domain representation model for a specific hydrological basin. He will use instances of cognitive units and methods defined in the generic model. Both generic configuration and domain representation models are expresed using a specific developed language called COVALTO. Once domain representation model has been simulated, the operator will analyze, using the operation interface, hydrological datas.
3 GENERIC CONFIGURATION MODEL Traditionally, the structure of a physical system is described by grouping a knowledges representation primitives finite collection. Using these primitives, knowledge ingenieer, who applies his hydrological experience in the design of generic models, chooses the required pieces in order to build a specific domain representation model. The hydrological basin structure representation is made by adding some conceptual components which represent domain physical objects. As a result, we must define a suitable mapping between physical objects and conceptual entities. Hydrological basin behaviour will be the result of adding the behaviour of each used component. This physical representation is independent of the specific problem to solve. Each problem will add to this model its own objects. So it is posible to build for the same domain, (in this case the hydrology), a common kernel of object that could be reused in other tasks like data validation, dam optimum strategies, etc. Like in other systems which apply artificial intellingence techniques to hydrological domains [Garrote, 90] and [Conejo, 95], we will use conceptual components called agents o cognitive units. We will use the following conceptual components: Agentes sensores: Pluviometer: it represents the sensors which measure the rain intensity. Gauging: it represents the sensors which measure a river flow. Level: it represents the sensors which measure the height of a dam. Basin physical agents: Basins: they are the places where rain-runoff transfer happens. Transport sections: it represents a river section of hydrological net. Dams: it is a regulation work on the hydrological net. Confluences: it is a point on the hydrologic net where one or more components meet. Each cognitive units will be represented by an own data collection, which we call attributes. These attributes collect features of the hydrological basin elements. Examples of attributes for the cognitive unit called pluviometer are the localizacion (location), which express, in UTM coordinates, where it is placed inside the basin; and medidas (measures), which is a time series which contains collected rain intensity. Also, the agents contains a model collection, that allows them to calculate the attributes values using other attributes. They are configurated by their corresponding parameters. These models represent physical operating theorical models and heuristic models defined by expert operators. The same cognitive unit can have more than one model. The architecture does not limit the number of models than can be used. There are the following types of models: Internals: defined by user, through the COVALTO language, using basic arithmetic operations like addition, substraction, multiplication, division, etc. Externals: implemented by a high level language. It is possible to declare generic models, which maps to mathematical funtions. It could be used by any cognitive unit. Examples of these generic models could be linear combination, convolution, etc. These models can be internals or externals. At the implementation point of view, these cognitive units are substancied by COVALTO
Figura 2: Cognitive unit syntax. Figura 3: Generic configuration model file (I). Figura 4: Generic configuration model file (II). language. It has a similar syntax to the object oriented languages, but it has a higher level of abstraction and it is suitable for the hydrological domain. Figure 2 shows the syntax used to define a cognitive unit in COVALTO. Figure 3 shows an example of a fragment of a generic configuration file for the basin of the Serpis river 4 DOMAIN REPRESENTATION MODEL Representations of a particular basin can be done using instances of the units, that have been declared in the generic configuration model. This collection of instances is called domain representation model. Domain representation model and generic configuration model will be simulated with some data collection files, which have been obtained from SAIH (Hydrological Information Automatic Systems). Figure 5 shows the syntax of an instance (object) in COVALTO. This syntax is similar to the syntax of a cognitive unit in the generic configuration model. Figure 6 shows the representation of Encarroz basin, placed in the basin of Serpis river. This object is an instance of the basin cognitive unit, that has been defined in the generic configuration file. The value that has been assigned to the pluviometros attribute, comes from the medidas attribute, which is a time series, of two instances of the pluviometer cognitive unit. Models parameters can be constant values, attributes from the object or attributes from other objects.
Figura 5: Syntax of an object in COVALTO. Figura 6: Domain representation model file. 5 HYDROLOGICAL MODELS CONSTRUCTION AND OPERATION INTERFACES It has been designed a visual programmation environment in order to offer a computational support for the purposed architecture. This tool can be used to build, calibrate and execute models. We pretend to help users to build a domain configuration model, so a basin can be easily designed and modified by users without programming knowledges. This environment will be useful to simulate and visualize the results in an orderly way. This tool helps us to build graphically the domain representation model. This will be traslated automatically into a text file written in COVALTO language. The entrance of this environment is the file of the generic configuration model. This file contains the cognitive units with their suitable collection of attributes and hydrological models. By this mechanism we have available a dynamic programming environment, which is configured by the generic model file. The number of attributes and models is not implemented in a static way. It is read from the generic configuration model, so we can include new external or internal models. Using the definitions in the generic model, we can define objects and assign values to their attributes. This assignment is done in three ways: by an interface based in interactive dialogs if the datas are constant; by reading values in episode and basin files, if the datas are series, coordinates and tables; or by the construction of a graph of relations among objects, if they are models. This graph is a visual representation of the domain, where the nodes represent domain object and the archs represent the relations among objects. The graph construction is the main axis of this tool, because of this is the support of other operations, and using it, the domain representation model file is generated. The steps to build this graph are the following: (1) Objects creation. By selecting the appropiate icon and putting it on the scheme, the cognitive unit will be selected. (2) Definition of the entrance and exit relations. By selecting the appropiate icons the archs are drawn.these archs represent a conection between two attributes of two objects. Generally, these attributes are time series of rain intensity, river flow, etc. The selection of entrance and exit attibutes is done in a intelligent way, using the information of the generic configuration model.
Figura 7: Application example for the basin of Serpis river. (3) Attributes values assigment. The assignment of values is done by interactive dialogs and by data files. The values of the exit attributes, which must be calculated using an hydrological model, are assigned by the selection of an available cognitive unit node. Also, it is possible to define specific models for each object, by COVALTO language. The previous operations must not be always done in the same order. It is possible to create and modify the graph in any way. The environment will make sure the internal consistency of the resultant configuration. Once the domain configuration has been defined by the graph, the constant values have been assigned to the attributes and the episode files and files which contain the coordinates of basins, river flows, etc., gaugings and dams tables, have been loaded; the following step is the simulation of the graph. This will be done by the orderly execution of the models of each object. The execution order is conditioned by the graph. The environment is able to do it automatically. Finally, once the simulation has been done, the results will be shown to the users. The interface will help to watch the attribute values of each object in a different window, or put them together in the same representation window. Also, it is possible to build schematic representations of the obtained information on the same graph or by specific sketchs. The time series values can be graphically represented in order to be analyzed later. 6 CONCLUSIONS In this work, it has been shown a visual tool, MOREA, which allows the construction of a representation of hydrological basins in a simple and intuitive way. Also, it lets make an exhaustive obtained data analysis of the obtained classes. This analysis was made by hand. The structure of the knowledge in two levels: a higher abstraction level, generic configuration model, and other with a less degree of abstraction, domain representation level, makes possible to build any kind of hydrological basin, and add any behavioral models for the cognitive units. Using this enviroment we obtain a tool which helps to
non-programmers to programme with a specific developed language. Users, by a graphical interface, are able to build in a transparent way, a domain representation model in COVALTO. So, the knowlegde acquisition and debugging is easier. Actually, we are working on the construction of a suitable support for data validation and diagnostic. It is based in the comparison of the observations in the real world with the results of the enviroment, which have been obtained in a previous simulation. The required validation knowledge is expressed by adding some coherence rules. These coherence rules are defined in COVALTO language, inside the generic configuration model file, and they impose some restrictions over the information of the objects. Also, these coherence rules let work simultaneously with a collection of suppositions about the behavior of the elements of a hydrological basin. Referencias [Alonso, 93] Alonso, M. Una contribución a la programación cognitiva: Arquitecturas de segunda generación para representación del conocimiento. Tesis Doctoral. Facultad de Informática. Universidad Politécnica de Madrid. Madrid. (1993). [Conejo, 95] Conejo, R. Sistemas basados en el conocimiento aplicados a la validación de información hidrológica en tiempo real. Tesis Doctoral. E.T.S.I. Caminos, Canales y Puertos. Universidad Politécnica de Madrid. Madrid. (1995). [Cuena, 94] Cuena, J. KSM: An Environment for Knowledge Oriented Design of Application Using Structured Knowledge Architectures en Applications and Impacts. IFIP 94. vol.2. Brunstein K. y Raubolds E. (eds). Elsevier Science B.V. Noth-Holand. (1994). [Garrote, 90] Garrote, L. Modelos hidrológicos de ayuda a la decisión en tiempo real basados en técnicas de inteligencia artificial. Tesis Doctoral. E.T.S.I. Caminos, Canales y Puertos. Universidad Politécnica de Madrid.Madrid. (1990). [Newell82] Newell, A. The Knowledge Level. Artificial Inteligence 18, (1982).