BLOQUE II: Documentación técnica
2. Diseño del Sistema
2.1.2 Catálogo de clases de análisis
In Section 3.4, we have already seen some properties of dynamic communication networks with unreliable agents. Here we elaborate on these properties and formalize some new ideas into a working Haskell code. We can then use this code to let the computer generate random networks with certain properties. As such, these properties act as assumptions on the network in order to test for certain hypotheses.
Recall the definition of a terminal agent: an agentais terminal if and only ifNa ={a}. So this means that ais terminal if she does not have the phone number of any other agent. We are interested in the consequences of this property of being terminal for dynamic communication networks. In particular, we are interested in the case that all the unreliable agents in a network are initially terminal. This means that initially no unreliable agent can make a call. Of course, in our dynamic setting this property is dynamic and initial terminal agents may not remain terminal after executing some call sequenceσ.
Still, we are wondering whether the fact that initially the unreliable agents are terminal has an effect on how well they can be identified. Intuitively it seems that a terminal agent has less power in the network: instead of actively initiating calls, a terminal agent can only passively receive them. However, as we will see in Section 5.4, there are situations in which the property of being terminal can strengthen the position of the unreliable agents in remaining uncovered.
Definition 5.1.1. [Unreliable Terminal] In a networkG= (A, R, f, N, S), the
unreliable agents are terminaliff for alla∈A\R,ais terminal, i.e.Na ={a}. An operation on graphs that is related to the property of being terminal, is the operation of skinning a graph. Simply put, skinning a graph means that all the terminal nodes of a graph are deleted. Formally, we have the following Definition 5.1.2.
Definition 5.1.2. [Skinning a Graph]Let G= (A, R, f, N, S)be a DCU graph.
Then s(G) is the result of skinningG, i.e. removing all terminal nodes from
G. That is, s(G) = (B, R0, f0, N0, S0)withB=A\TG,R0=R\TG,f0 =f|TG,
N0 =N∪B2 andS0 =S∪B2, whereT
G is the set of terminal nodes ofG. I.e.
TG ={x∈A| ¬∃y∈A s.t. xN y}.
Skinning a graph is not a closure operation. That means that performing the operation twice does not yield the same result as performing it only once. That means that there are graphs such thats(s(G))6=s(G). Consider the following Example 5.1.3.
Example 5.1.3. Let G = (A, R, f, N, S) be an initial DCU graph with A =
R={a, b, c} andN ={(a, b),(b, c)}R. Thens(G)isGwithout agentc, whereas
s(s(G))isGwithout agentsb andc. See below.
a b c a b a
s(G) s(G)
Recall that an agentaisisolated if in addition no other agent has her phone number, i.e. wheneverNa ={a} and for each b∈A such thatb6=awe have that{a} *Nb. For our purposes, isolated agents are not interesting because they will never interfere with the network.
Haskell Code
Code for checking if unreliable agents in the network are terminal.
u n r e l i a b l e T e r m i n a l :: T a b l e - > B o o l
u n r e l i a b l e T e r m i n a l [] = T r u e
u n r e l i a b l e T e r m i n a l ((a,(aN,(_aX,_aY,_aZ) ,aType,_ a P r o p) ) :r e s t) =
not (a T y p e /= R e l i a b l e && aN /= [a]) && u n r e l i a b l e T e r m i n a l r e s t
Finding isolated agents in a network and deleting them.
- - f i n d i s o l a t e d a g e n t s in a n e t w o r k i s o l a t e d A g e n t s :: T a b l e - > [A g e n t] i s o l a t e d A g e n t s t a b l e = l o o p t a b l e t a b l e [] w h e r e l o o p :: T a b l e - > T a b l e - > [A g e n t] - > [A g e n t] l o o p _ [] l i s t O f A g e n t s = l i s t O f A g e n t s l o o p t ((a,(aN,(aX,aY,aZ) ,aType,a P r o p) ) :r e s t) l i s t O f A g e n t s = if aN == [a] && n o b o d y L i k e s M e a o t h e r s T a b l e t h e n l o o p t r e s t (a:l i s t O f A g e n t s) e l s e l o o p t r e s t l i s t O f A g e n t s w h e r e o t h e r s T a b l e = t \\ [(a,(aN,(aX,aY,aZ) ,aType,a P r o p) ) ]
n o b o d y L i k e s M e :: A g e n t - > T a b l e - > B o o l n o b o d y L i k e s M e _ [] = T r u e n o b o d y L i k e s M e c ((_,(bN,(_,_,_) ,_,_) ) :t r e s t) = c ‘notElem‘ bN && n o b o d y L i k e s M e c t r e s t - - d e l e t e i s o l a t e d a g e n t s f r o m n e t w o r k d e l e t e I s o l a t e d :: T a b l e - > T a b l e d e l e t e I s o l a t e d t = dI t t w h e r e dI _ [] = [] dI t a b l e ((a,(aN,(aX,aY,aZ) ,aType,a P r o p) ) :r e s t) = if a ‘elem‘ i s o l a t e d A g e n t s t a b l e t h e n dI t a b l e r e s t e l s e (a,(aN,(aX,aY,aZ) ,aType,a P r o p) ) : dI t a b l e r e s t