• No se han encontrado resultados

L‘ensenyament musical a les lleis d‘educació

1. L’ensenyament musical des de l’antiguitat i el paper que juga a l’escola.

1.7 Música, legislació i ensenyament a l‘Estat espanyol

1.7.3 L‘ensenyament musical a les lleis d‘educació

Describing the routeing constraints

One particular type of behaviour is already implicit in the description of the network; data can travel bidirectionally between adjacent entities. Therefore a relationship between two entities implies the possibility of data flow between the two.

A second type of routeing behaviour is when a routeing entity knows that all the traffic to one particular entity has to go via another entity. This routeing behaviour is built on top of the first one and takes precedence over the first one. For example, given the simple topology in Figure 6 . 6 the implicit routeing algorithm would allow two routes between

B1 and HI; OBI,LI,B2,HI] and [B1,L2,B2,H1]. If however, B1 has the additional con­ straint that all the traffic to HI has to be sent via LI, then the only legal route is [B1,L1,B2,H1]. LI HI H2 B2 B1 L2

FIGURE 6 . 6 Simple network topology

This higher level routeing algorithm will be described as a system of constraints; a con­ straint takes the form: to go from entity A to entity B we have to go via entities C, D etc. In Prolog this is a term of the form: constraint(A-B,[List]).

Two additional constraints are applied:

- No route between two elements can go via a third element more than once; this blocks the infinite loops that would be created otherwise; furthermore once an element is included in a route, if that route becomes suspect, there is no point in having an element in the route more than once as its membership of the route makes it suspect already. - Data can go to a host only if that host is the final destination or offers the service that is the final destination. If this constraint was not imposed, a host that is on two subnetworks (such as H2 or H4 in Figure 6.5) would also be performing the function of bridge, i.e would be transferring data from one subnetwork to another, which is not normally a host’s function.

Generating the legal routes

The next stage is to generate all the legal routes between any two points A and B, given the information about the entities in the system, and the routeing constraints. This prob­ lem is akin to the general common problem of finding a path between two points in a connected graph, where the nodes of the graph are the services, hosts, bridges and sub­ networks, and the edges are the links between those entities. Specific aspects of the route­ ing problem are that:

- all the legal paths between two points are wanted, rather than just one;

- a host is only acceptable as the next hop in the route if it is the second hop, the last hop or the last but one hop;

- there are additional routeing constraints.

Without these specific aspects, any simple graph walking algorithm will do.

To find all the legal paths using Prolog is very easy; backtracking is enforced every time a solution is reached until no new solution can be found.

Dealing with the difference between hosts and bridges is also quite easy. The route searching algorithm can easily eliminate the next hop hosts which do not conform to the acceptability definition for hosts.

As seen before a routeing constraint is of the form: to go from A to B, go via [C,D,...]. This is equivalent to breaking the problem into subproblems:

go(A,C), go(C,D), go(D,...), go(...,B)

where all the subproblems have to be solved (and type problem)

If there is no constraint, the next hop can be any of the adjacent entities. For example to go from A to B (assuming that C,D and E are the adjacent entities to A), the problem can be broken into subproblems:

{go(A,C) and (C,B)} or {go(A,D) and (D,B)} or |go(A,E) and (E,B)} where it is sufficient to solve only one of the problems (or type problem).

The fact that there is a combination of and and or type problems suggests an AND/OR tree type solution for the route finding algorithm. In an AND/OR tree, the nodes of the tree correspond to the problems to be solved. The root of the tree is the initial problem (in this case to find the paths from A to B), and the following levels are the corresponding subproblems. An example is depicted in Figure 6.7. A curved arc denotes an and type relationship, meaning all the subtrees have to be solved. Otherwise, only one of the

go(A-Z)

A-Z via C A-Z via B

A-B B-Z A-C C-Z

FIGURE 6.7 AND/OR problem decomposition

subtrees has to be solved. A goal node is a trivial subproblem of the type go(B-B). Each solution is a tree T defined recursively as follows:

- The initial problem P is the root of T;

- If P was decomposed into OR subtrees, then one of its successor subproblems together with its own solution tree is in T.

- If P was decomposed into AND subtrees, then all of its successor subproblems together with their solution trees are in T.

6.5.4. Using the network structure and behaviour description to generate suspects