© Copyright JASSS

  JASSS logo ----

D.W. Pearson and M-R. Boudarel (2001)

Pair Interactions : Real and Perceived Attitudes

Journal of Artificial Societies and Social Simulation vol. 4, no. 4
<http://jasss.soc.surrey.ac.uk/4/4/4.html>

To cite articles published in the Journal of Artificial Societies and Social Simulation, please reference the above information and include paragraph numbers if necessary

Received: 29-Mar-01      Accepted: 30-Sep-01      Published: 31-Oct-01


* Abstract

In this article we look at how a social interaction model can be developed that takes into account the influence that perceived attitudes can have on the resulting dynamics. The model is based on a pair interaction situation and a master equation approach. The model can be easily programmed using standard high level simulation languages. Some simulation studies are presented in the article.

Keywords:
Attitudes; Quantitative Socio-dynamics; Self-confidence

* Introduction

1.1
One of the principal objectives of quantitative sociodynamics is to develop mathematical models capable of simulating, and in some cases understanding, social phenomena. It is a relatively new field of research and leans heavily on models already existing and applied to physical phenomena. A very good introduction to the field and the particular approach adopted in this article can be found in (Helbing 1995) or in (Weidlich and Haag 1983).

1.2
In our work, we are trying to model confidence levels in networks of individuals. Our main area of application is enterprise networks, where a number of small to medium size enterprises get together to work on a common theme. Our ultimate aim is to optimise such networks and detect miss functions when they occur, for that we need to develop a mathematical model (Pearson et al 2001a). Due to the fact that there are few employees in each of the enterprises, a mathematical model must take into account the human factors. Of particular interest in this modelling context are pair interactions between individuals, which can influence confidence levels.

1.3
As its name suggests, a quantitative sociodynamic model is a dynamical system. We model confidence levels as dynamical variables and follow their temporal evolutions. For our first attempt at modelling this particular situation we have adopted a probabilistic approach based on the so called master equation (Helbing 1995). What is new in our work is the fact that we are looking not only at how confidence levels may evolve, but also how perceived confidence levels may affect the dynamics. This relates to the idea, presented in the interesting book by (Le Cardinal, Guyonnet and Pouzoullic 1997), that the confidence level of one individual towards another depends not only on his/her own intrinsic level of confidence towards the other but also on what he/she thinks that the other thinks of him/her. To add to the general complexity of this situation, we add to our model a level of self-confidence.

1.4
The article is split into two main parts. In the first part we present the mathematical model. We deliberately avoid presenting a general introduction to the master equation approach, which would take up too much space. We choose rather to go straight into the development of our model and incite the reader to look up the above cited books on sociodynamics for the relevant mathematical background. In the second part we present some simulation studies. Once again, due to space limitations, we do not present an exhaustive study but rather a selection of simulations showing a particular aspect of the model and its capabilities.

Development of a Mathematical Model

2.1
We consider the situation depicted in Figure 1. We are trying to model a pair interaction where two individuals are in contact for an appreciable length of time, i.e. this is not meant to be an instantaneous interaction. The solid arcs in the figure represent the reality, in other words the solid arc from individual 1 to individual 2 represents individual 1's attitude (level of confidence) towards individual 2 etc. In a similar fashion the dotted arcs represent perceived attitudes, i.e. the dotted arc from individual 1 to individual 2 represents individual 1's attitude towards individual 2 as perceived by individual 2. Arcs beginning and ending at the same individual represent self-confidence. Thus the solid arc from individual 1 to individual 1 represents the attitude of this individual towards him/herself and the dotted arc represents what individual 2 perceives of individual 1's self-confidence.

Figure 1: Pair interaction of two individuals

2.2
In order to develop a mathematical model of the situation illustrated in Figure 1 we define the following variables. Let xij denote the real attitude of individual j towards individual i and zij denote the perceived attitude of individual j towards individual i as perceived by individual i. For simplicity of notation we define the following vectors.

2.3
Hence x is the overall view of what is really happening, x1 is the world as perceived by individual 1 and likewise x2 is the world as perceived by individual 2.

2.4
For the variables x11 etc. we assume them to be mean values calculated from stochastic distributions. In other words we imagine a scale of discrete values representing a confidence level, for reasons of simplicity we define a scale symmetric about the origin [-N,N] where -N corresponds to total non-confidence, 0 to a neutral level of confidence and N corresponds to absolute confidence. We let xnij denote the probability that individual j has confidence level n towards individual i, where n∈[-N,N]. Then each variable xij is simply the mean value of the distribution

2.5
Now, the probabilities, hence the variables xnij, will evolve with time. Strictly speaking we should write xnij(t), but we suppress explicit mention of t in order to keep the notation as uncluttered as possible.

2.6
In order to define the temporal evolution of the probabilities xnij we adopt the master equation approach. As explained in the introduction, we do not present the full details of this approach here due to the lack of space, the reader is referred to the excellent books by (Helbing 1995) and (Weidlich and Haag 1983) for an introduction. Essentially the time evolution of xnij is described by the following differential equation

2.7
where wij(n|n+1) denotes the transitional probability from a confidence level of n+1 to a level of n, etc. and . Notice that we assume only local transitional probabilities, i.e. we only allow a transition from n to n-1 or n+1 and not to n-2, n+2 etc. We thus avoid collective attitude changes in our model, although this is a point to be investigated in future work.

2.8
We define uij(n):=wij(n+1|n) and vij(n):=wij(n-1|n), the above can then be succinctly written as

(1)

with the boundary conditions uij(N)xNy=vij(-N)xijN=0.

2.9
Our model is based on the transitional probability functions uij and vij appearing in the set of equations defined by (1). First of all we consider individual 1's self confidence. Putting yourself in the place of individual 1 you could imagine the following trends in your level of self confidence

  • You have an inbuilt level of self confidence.
  • If you believe that someone has confidence in you then this is likely to increase your own self confidence.
  • This effect is all the more strengthened if the person's own self confidence, as perceived by you, is high.
  • However the effect is attenuated if you perceive the person's self confidence as being too high.

2.10
Based on these thoughts, we propose the following functions

(2)

where α11∈[-N,N], α∈[0,1], β≥0 and γ≥0 are parameters and f is a function having a trapezoidal form as shown in figure 2.

Figure 2: Function f

2.11
For each of the two functions in (2) the first term represents the fixed level of self confidence which is based on the value α11. The second term represents the trend to change, towards n-1 or n+1, based upon the perceived level of confidence of individual 2 towards individual 1. The second term is further multiplied by a function depending on the self confidence of individual 2 as perceived by individual 1. As depicted in Figure 2, this function is assumed to have some sort of trapezoidal form with parameters f1, f2, n1 and n2. The particular form for this function was chosen for two reasons. First of all, we believe that the more we perceive another person to be self confident then the more weight we give to what that person thinks including what we believe that person thinks of us. This function will reach a plateau at some value n1 where we will have practically absolute confidence in what the person says and what we believe the person thinks of us. However, if the person is perceived to be too self confident, then we are likely to give less weight to what that person thinks. In the vernacular, nobody really likes a "smart arse". This is where the second threshold value n2 comes into play. Secondly, the trapezoidal form was chosen for numerical simplicity.

2.12
We remark that the parameter α11 is common to both functions u11 and v11 in (2) but all the other parameters can differ between the two functions.

2.13
The functions u21 and v21 are determined in a similar fashion. Putting yourself once again in the place of individual 1 you could imagine yourself thinking of individual 2 as follows.

  • You have an a priori level of confidence towards individual 2.
  • If you perceive individual 2 as having a certain level of confidence in you then you would tend to reciprocate this level.

2.14
Taking these ideas into consideration we propose the following forms for the functions u21 and v21.

(3)

2.15
In (3) the first term in each case corresponds to the a priori level of confidence and the second term models individual 1's willingness to change his/her opinion of individual 2 based on the perceived level of confidence of individual 2 towards individual 1. As in (2) the parameter α21 is common to the two functions, but the other parameters can vary between the functions.

2.16
The question now is how to model the dynamical evolution of z12 and z22. In this, our first attempt at modelling this particular situation, we assume that these variables evolve according to some prefixed estimation of confidence and self confidence (estimated by individual 1 that is). In other words we let pij(n) and qij(n) be the estimated values of uij(n) and vij(n) respectively and bij be the estimated value of aij, as estimated for individual 2 by individual 1, then we have

(4)

2.17
The functions u22, v22, u12, v12, p11, q11, p21 and q21 appertaining to individual 2 are developed in exactly the same way as (2), (3) and (4) for individual 1 and are not presented here.

2.18
A few words about the influence of the various parameters in (2), (3) and (4). The closer α is to 1 then the more "self centred" the individual, i.e. the less likely to take into consideration the perceived opinion of the other. Symmetrically, the closer α is to 0 then the individual is less self centred and more likely to be influenced by the perceived opinion of the other. The two parameters β and γ have the effect of peaking or spreading out the exponential functions. Large values of β and γ mean that the exponentials are highly peaked, resulting in a smaller transitional probability for values little removed from the central value. Smaller values of β and γ have the reverse effect of spreading out the exponentials, resulting in relatively high transitional probabilities for tail values.

Simulation Studies

3.1
The model presented above is fairly easy to programme in high or low level languages. For simplicity and rapidity we chose to programme it in Matlab. No specific hardware requirements are necessary, a standard modern PC is quite sufficient. The Matlab codes are included in an annex for anyone who wishes to try some simulations.

3.2
Quite obviously, there are a lot of parameters in our model. Hence, a lot of different simulations can be carried out, representing a lot of different scenarii. We present two simulations here in order to illustrate the way in which the model works.

3.3
For both simulations we fix the same value N=5. Both simulations concern the following scenario.

Individual 1

  • Has a high level of self confidence.
  • Doesn't like individual 2.
  • Believes that individual 2 doesn't like individual 1.
  • Believes that individual 2 has a high level of self confidence.

Individual 2

  • Has a neutral level of self confidence.
  • Likes individual 1.
  • Believes that individual 1 likes individual 2.
  • Believes that individual 1 has a high level of self confidence

3.4
We chose the following values for the parameters αij

3.5
For individual 1 we set α=0.9 and for individual 2 α=0.2, meaning that individual 1 is rather self opinionated whilst individual 2 is influenced by others. For both individuals we set β=2. For individual 1 we chose γ=2. The difference between the two simulations comes from the choice of γ for individual 2. In the first simulation we set γ=0.5, thus modelling an individual whose self confidence is influenced by the perceived level of confidence of individual 1 towards individual 2. In the second simulation we set γ=0.1, thus modelling an individual whose self confidence is even more strongly influenced by a perceived level of confidence.

3.6
For all the simulations we used the same function f as shown in Figure 3. We cannot claim to have based our choice of this function on scientific grounds. We simply believe that this particular choice is reasonable.

Figure 3: The particular choice of function f

3.7
For the initial distributions we set up three different profiles. The first one is shown in Figure 4 and represents a distribution biased towards confidence, the second is shown in Figure 5 and represents a distribution biased towards non-confidence and the third is shown in Figure 6 and represents neutral confidence.

Figure 4: Initial distribution : biased towards confidence

Figure 5: Initial distribution : biased towards non-confidence

Figure 6: Initial distribution : neutral confidence

3.8
The first set of simulation results are shown in Figures 7, 8, 9 and 10. In each of the following figures relating to the simulation results the y-axis corresponds to the confidence level and the z-axis corresponds to the probability associated to the confidence level. So that the profile in the bottom left hand corner of each image corresponds to one of the Figures 4, 5 or 6. The x-axis corresponds to time and so the surface depicted in each image represents the way in with the initial distributions in Figures 4, 5 and 6 evolve dynamically. A slice perpendicular to the x-axis will bring you back to a distribution like Figures 4, 5 and 6, but at a later time in the simulation. The time scale is not particularly important for the present work. The units could be chosen to be days or weeks depending on the particular situation.

3.9
In Figures 7 and 8 we see the results relating to individual 1, thus the two images in Figure 7 are what individual 1 knows as being true, or really experiences, whilst the two images in Figure 8 show what individual 1 perceives to be true. Likewise, in Figures 9 and 10 we see the world view relating to individual 2. In this case the two images in Figure 10 show what is known by the individual and the two in Figure 9 show what is perceived by the individual. Comparing the four figures we see, for example from the images at the top of Figures 8 and 10, that individual 1 thinks that individual 2 does not have confidence in individual 1 however, in reality, individual 2 does have confidence in individual 1.

Figure 7: Simulation results - confidence levels as experienced by individual 1

Figure 8: Simulation results - confidence levels as perceived by individual 1

Figure 9: Simulation results - confidence levels as perceived by individual 2

Figure 10: Simulation results - confidence levels as experienced by individual 2

3.10
The results of the second simulation can be seen in Figures 11 and 12 (the world as seen by individual 1) and 13 and 14 (the world as seen by individual 2). We notice that the results for individual 1 in both simulations are very similar, as we would expect, in comparing Figures 7, 8, 11 and 12. When we compare Figures 9, 10, 13 and 14 however, we find that in the second simulation individual 2's self-confidence starts to increase because he/she is much more influenced by what he/she perceives to be true.

Figure 11: Simulation results - confidence levels as experienced by individual 1

Figure 12: Simulation results - confidence levels as perceived by individual 1

Figure 13: Simulation results - confidence levels as perceived by individual 2

Figure 14: Simulation results - confidence levels as experienced by individual 2

Perspectives

4.1
We have developed a model which, although lacking in many respects, we believe approaches the real situation that we are trying to model. Why do we believe this? Well, ordinary daily contact with people in our workplace and in our private lives tells us that human relations are important. A human relation between two (or more) individuals is based on many different feelings such as love, friendship, trust, etc. Of these feelings, confidence plays a vital role, both confidence towards others and self confidence. By personnel experience we know that if someone declares that he/she has confidence in us then this simple fact will most likely strengthen our self confidence. Not only that, if we are self confident because others have confidence in us then we are more likely to have confidence in others. In a lot of models, perceived confidence (i.e. a level of confidence that is not directly measured) is simply neglected. In some cases because it is considered unnecessary, or too complicated to deal with, or even undefined. However, the psychologists can tell us an awful lot about ourselves and about others by various means of analysis. Therefore for us, the mathematical modellers, we must try to include these variables in our models so that, at some time in the future (the near future we hope), our lines of thought will converge and our models will become more and more realistic.

4.2
Although it would be nice, indeed some researchers believe that it is possible, we humans cannot read our neighbours thoughts. As a result, we are always confronted with the problem of knowing what we ourselves feel but only being able to deduce what others feel about us. A social comportment model that does not take into account this uncertainty we believe to be lacking in an essential part. Hence, our quest.

4.3
We are actively engaged in an analysis of our model, to determine the influence of each parameter. We are also looking at the problem of parameter identification, that is to say fitting our model to a particular observed behaviour. Needless to say, this problem is very difficult indeed and we can foresee a lot of work necessary in order to resolve it.

4.4
We are also looking at improvements of the model. We may continue with the probabilistic approach if this seems the most fruitful. However, we are not limited to the master equation approach and we are looking at other candidates. Of these, we believe that a fuzzy logic based approach is well worth investigating. In fact, we have already made a tentative start in this direction (Pearson and Dray 2001b).


* References

HELBING, D. (1995), Quantitative Sociodynamics, Kluwer Academic Publishers.

LE CARDINAL, G., GUYONNET, J.-F. and POUZOULLIC (1997), La Dynamique de la Confiance, Dunod.

PEARSON, D.W., ALBERT, P., BESOMBES, B., BOUDEREL, M.-R., MARCON, E. and MNEMOI, G. (2001a), Modelling Enterprise Networks: A Master Equation Approach, to appear European Journal of Operational Research.

PEARSON, D.W. and DRAY, G. (2001b), A Fuzzy Approach to Sociodynamical Interactions, Proceedings International Conference on Artificial Neural Networks and Genetic Algorithms, Prague, Czech Republic.

WEIDLICH, W. and HAAG, G. (1983), Concepts and Models of a Quantitative Sociology, Springer-Verlag.


Annex - Matlab Codes

The main program


clear


clf


N=5;


a=[N -N -N N N N N 0];
  

   alpha=[0.9 0.9 1 1 1 1 0.2 0.2];
   

   beta=[2 2 2 2 2 2 2 2];
  

   gamma=[2 2 2 2 0.1 0.1 0.1 0.1];



fp=[1 4 0.5 0.5

    1 4 0.5 0.5];



dist1=[0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0.1 ; 0.2 ; 0.4 ; 0.2 ; 0.1];

dist2=[0.1 ; 0.2 ; 0.4 ; 0.2 ; 0.1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0];

dist3=[0 ; 0 ; 0 ; 0.1 ; 0.2 ; 0.4 ; 0.2 ; 0.1 ; 0 ; 0 ; 0];



x0=[dist1 ; dist2 ; dist2 ; dist1 ; dist1 ; dist1 ; dist1 ; dist3];



[t,x]=ode45('group_interaction',[0,30],x0,[],a,N,alpha,beta,gamma,fp);



clf



u=-N:N;

for j=1:length(t)

   for i=1:2*N+1

      z11(i,j)=x(j,i);

      z21(i,j)=x(j,2*N+1+i);

      zhat12(i,j)=x(j,2*(2*N+1)+i);

      zhat22(i,j)=x(j,3*(2*N+1)+i);

      zhat11(i,j)=x(j,4*(2*N+1)+i);

      zhat21(i,j)=x(j,5*(2*N+1)+i);

      z12(i,j)=x(j,6*(2*N+1)+i);

      z22(i,j)=x(j,7*(2*N+1)+i);

   end

end



for i=1:2*N+1

   f(i)=funcf(u(i),fp(1,1),fp(1,2),fp(1,3),fp(1,4),N);

end



% the world as seen by individual 1



figure(1)



subplot(2,1,1)

surfl(t,u,z11)

xlabel('t')

ylabel('confidence')

zlabel('x_{11}')

shading interp

colormap('cool')



subplot(2,1,2)

surfl(t,u,z21)

xlabel('t')

ylabel('confidence')

zlabel('x_{21}')

shading interp

colormap('cool')



figure(2)



subplot(2,1,1)

surfl(t,u,zhat12)

xlabel('t')

ylabel('confidence')

zlabel('z_{12}')

shading interp

colormap('cool')



subplot(2,1,2)

surfl(t,u,zhat22)

xlabel('t')

ylabel('confidence')

zlabel('z_{22}')

shading interp

colormap('cool')



% the world as seen by individual 2



figure(3)



subplot(2,1,1)

surfl(t,u,zhat11)

xlabel('t')

ylabel('confidence')

zlabel('z_{11}')

shading interp

colormap('cool')



subplot(2,1,2)

surfl(t,u,zhat21)

xlabel('t')

ylabel('confidence')

zlabel('z_{21}')

shading interp

colormap('cool')



figure(4)



subplot(2,1,1)

surfl(t,u,z12)

xlabel('t')

ylabel('confidence')

zlabel('x_{12}')

shading interp

colormap('cool')



subplot(2,1,2)

surfl(t,u,z22)

xlabel('t')

ylabel('confidence')

zlabel('x_{22}')

shading interp

colormap('cool')



The various functions called by the main program



function f=funcf(x,n1,n2,f1,f2,N)



if x=n1 &
x f(1)=f(1)-uij(x,-N,1,3,4,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(1);
for n=-N+1:N-1 i=n+N+1; f(i)=vij(x,n+1,1,3,4,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i+1 ); f(i)=f(i)-vij(x,n,1,3,4,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); f(i)=f(i)+uij(x,n-1,1,3,4,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i-1); f(i)=f(i)-uij(x,n,1,3,4,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); end f(2*N+1)=-vij(x,N,1,3,4,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*N+1); f(2*N+1)=f(2*N+1)+uij(x,N-1,1,3,4,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*N); % x21 f(2*N+2)=vij(x,-N+1,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*N+3); f(2*N+2)=f(2*N+2)-uij(x,-N,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*N+2); for n=-N+1:N-1 i=n+3*N+2; f(i)=vij(x,n+1,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i+1); f(i)=f(i)-vij(x,n,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); f(i)=f(i)+uij(x,n-1,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i-1); f(i)=f(i)-uij(x,n,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); end f(2*(2*N+1))=-vij(x,N,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*(2*N+1)); f(2*(2*N+1))=f(2*(2*N+1))+uij(x,N-1,2,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*(2*N+1)-1); % z12 f(2*(2*N+1)+1)=vij(x,-N+1,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*(2*N+1)+2); f(2*(2*N+1)+1)=f(2*(2*N+1)+1)-uij(x,-N,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(2*(2*N+1)+1); for n=-N+1:N-1 i=n+2*(2*N+1)+N+1; f(i)=vij(x,n+1,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i+1); f(i)=f(i)-vij(x,n,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); f(i)=f(i)+uij(x,n-1,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i-1); f(i)=f(i)-uij(x,n,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); end f(3*(2*N+1))=-vij(x,N,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(3*(2*N+1)); f(3*(2*N+1))=f(3*(2*N+1))+uij(x,N-1,3,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(3*(2*N+1)-1); % z22 f(3*(2*N+1)+1)=vij(x,-N+1,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(3*(2*N+1)+2); f(3*(2*N+1)+1)=f(3*(2*N+1)+1)-uij(x,-N,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(3*(2*N+1)+1); for n=-N+1:N-1 i=n+3*(2*N+1)+N+1; f(i)=vij(x,n+1,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i+1); f(i)=f(i)-vij(x,n,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); f(i)=f(i)+uij(x,n-1,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i-1); f(i)=f(i)-uij(x,n,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(i); end f(4*(2*N+1))=-vij(x,N,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(4*(2*N+1)); f(4*(2*N+1))=f(4*(2*N+1))+uij(x,N-1,4,3,0,a,N,alpha,beta,gamma,fp(1,1),fp(1,2),fp(1,3),fp(1,4))*x(4*(2*N+1)-1); % z11 f(4*(2*N+1)+1)=vij(x,-N+1,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(4*(2*N+1)+2); f(4*(2*N+1)+1)=f(4*(2*N+1)+1)-uij(x,-N,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(4*(2*N+1)+1); for n=-N+1:N-1 i=n+4*(2*N+1)+N+1; f(i)=vij(x,n+1,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i+1); f(i)=f(i)-vij(x,n,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); f(i)=f(i)+uij(x,n-1,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i-1); f(i)=f(i)-uij(x,n,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); end f(5*(2*N+1))=-vij(x,N,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(5*(2*N+1)); f(5*(2*N+1))=f(5*(2*N+1))+uij(x,N-1,5,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(5*(2*N+1)-1); % z21 f(5*(2*N+1)+1)=vij(x,-N+1,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(5*(2*N+1)+2); f(5*(2*N+1)+1)=f(5*(2*N+1)+1)-uij(x,-N,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(5*(2*N+1)+1); for n=-N+1:N-1 i=n+5*(2*N+1)+N+1; f(i)=vij(x,n+1,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i+1); f(i)=f(i)-vij(x,n,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); f(i)=f(i)+uij(x,n-1,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i-1); f(i)=f(i)-uij(x,n,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); end f(6*(2*N+1))=-vij(x,N,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(6*(2*N+1)); f(6*(2*N+1))=f(6*(2*N+1))+uij(x,N-1,6,3,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(6*(2*N+1)-1); % x12 f(6*(2*N+1)+1)=vij(x,-N+1,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(6*(2*N+1)+2); f(6*(2*N+1)+1)=f(6*(2*N+1)+1)-uij(x,-N,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(6*(2*N+1)+1); for n=-N+1:N-1 i=n+6*(2*N+1)+N+1; f(i)=vij(x,n+1,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i+1); f(i)=f(i)-vij(x,n,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); f(i)=f(i)+uij(x,n-1,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i-1); f(i)=f(i)-uij(x,n,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); end f(7*(2*N+1))=-vij(x,N,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(7*(2*N+1)); f(7*(2*N+1))=f(7*(2*N+1))+uij(x,N-1,7,6,0,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(7*(2*N+1)-1); % x22 f(7*(2*N+1)+1)=vij(x,-N+1,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(7*(2*N+1)+2); f(7*(2*N+1)+1)=f(7*(2*N+1)+1)-uij(x,-N,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(7*(2*N+1)+1); for n=-N+1:N-1 i=n+7*(2*N+1)+N+1; f(i)=vij(x,n+1,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i+1); f(i)=f(i)-vij(x,n,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); f(i)=f(i)+uij(x,n-1,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i-1); f(i)=f(i)-uij(x,n,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(i); end f(8*(2*N+1))=-vij(x,N,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(8*(2*N+1)); f(8*(2*N+1))=f(8*(2*N+1))+uij(x,N-1,8,6,5,a,N,alpha,beta,gamma,fp(2,1),fp(2,2),fp(2,3),fp(2,4))*x(8*(2*N+1)-1); f=f'; function f=uij(x,n,k,l,m,a,N,alpha,beta,gamma,n1,n2,f1,f2) f=alpha(k)*exp(-beta(k)*((n+1-a(k))^2)); if m==0 f=f+(1-alpha(k))*exp(-gamma(k)*((n+1-Exij(x,l,N))^2)); else f=f+(1-alpha(k))*exp(-gamma(k)*((n+1-Exij(x,l,N))^2))*funcf(Exij(x,m,N),n1,n2,f1,f2,N); end function f=vij(x,n,k,l,m,a,N,alpha,beta,gamma,n1,n2,f1,f2) f=alpha(k)*exp(-beta(k)*((n-1-a(k))^2)); if m==0 f=f+(1-alpha(k))*exp(-gamma(k)*((n-1-Exij(x,l,N))^2)); else f=f+(1-alpha(k))*exp(-gamma(k)*((n-1-Exij(x,l,N))^2))*funcf(Exij(x,m,N),n1,n2,f1,f2,N); end
----

ButtonReturn to Contents of this issue

© Copyright Journal of Artificial Societies and Social Simulation, [2001]