You are on page 1of 15

# Simulation of barter processes as

heuristic method for multiobjective
optimization
Stefano Nasini
1) Bargaining problem
2) The associated Game
3) Simulation model with Petri Net
4) Java implementation
5) Experimental design
6) Conclusions and Results
The k-lateral bargaining problem concerns the ways k agents cooperate when non-
cooperation leads to Pareto-inefficient output in the allocation of a fixed quantity. Such a
problem has been modelled from different outlooks and still represents a source of
uncertainty in Social Science and Decision Theory.
Bargaining problem
Suppose two agents are endowed with two
respective points in the 3-dimensional commodity
space and utility function which represents their
preference relation has been defined.
The related bargaining problem consists in finding
two new points which keep untouched the overall
amount of endowments.
¦
¦
¦
¦
¦
¹
¦
¦
¦
¦
¦
´
¦
>
+ = +
+ = +
+ = +
0
. .
) , , ( max
) , , ( max
2
3
1
3
2
3
1
3
2
2
1
2
2
2
1
2
2
1
1
1
2
1
1
1
2
3
2
2
2
1
2 (
1
3
1
2
1
1
1 (
i
j
x
e e x x
e e x x
e e x x
t s
x x x u
x x x u
Bargaining problem
As far as the determination of a unique solution is
concerned, Nash suggested that a solution should
fulfil certain conditions:
-symmetry,
- invariant to affine transformations,
- Pareto efficiency,
- independence of irrelevant alternatives.
The solution proposed by Nash considers the compact and convex payoff space P = {(u1, u2)|
u1 > t1; u1 > t2}, where (t1, t2) is the vector of disagreement payoff, and a set H of non-dominated
vectors of P.
The associated Game
Consider a lexicographic order in the Cartesian product of the commodities type. Let (i,j) be an element
of such a set of ordered pares. Then, a sequential game is defined as follows. The first element (i,j) is
selected and an intermediary chooses within three actions:
] ) ' , ( ), ' , ( [
2 1
c c c c + ÷ ÷ +
j i j i
x x Utility y y Utility
] ) ' , ( ), ' , ( [
2 1
c c c c ÷ + + ÷
j i j i
x x Utility y y Utility
] ) ( ), , ( [ ,
2 1 j i j i
x x Utility y y Utility
¹
´
¦
=
otherwise 0
by dominated Pareto t isn' ω if 1
payoff(
)] , ( ), , (
2 1
[
j i j i
y y Utility x x Utility
) ω
The payoff function of the intermediary is the following
The associated Game
The intermediary proposes exactly that trade
which isn’t Pareto-dominated by
. If the third
strategy has been chosen, then the second
couple of good (i,j) is selected and the
intermediary must chosen again between
and .
] ) ( ), , ( [ ,
2 1 j i j i
x x Utility y y Utility
] ) ' , ( ), ' , ( [
2 1
c c c c + ÷ ÷ +
j i j i
x x Utility y y Utility
] ) ' , ( ), ' , ( [
2 1
c c c c ÷ + + ÷
j i j i
x x Utility y y Utility
] ) ( ), , ( [ ,
2 1 j i j i
x x Utility y y Utility
Then the two agent sequentially choose
whether to accept the proposal, in
accordance with their associated utility
functions.
Simulation model with Petri Net
We used a Colored
Timestamp Petri Net. Each
token has a timestamp,
which is a particular color
used to specify the earliest
time when it can be
consumed.
The transition consumes @
units firing time.
In an economy with three commodities there will be 4 tokens in p.1 at initial marking. The first
transaction to fire is t.2 because it is the unique with @=0. Then, the clock will be updated as
@++ so that t.1 will fire since the timestamps associated to its incoming tokens are @ = 1,
which is the value of the current clock. The clock is again updated (clock = 2) and the next
transaction to fire will be t.1.
Uti_A =
all amount;
@ ++;
true;
i = 1;
@ ++;
Iterations++;
if ( Utility(u_a, All_A+y-z) > Uti_A && Utility(u_b, All_B-y+z) > Uti_A )
{
Uti_A = Utility(u_a, All_A+y-z);
Uti_B = Utility(u_b, All_B-y+z);
All_A = All_A+y-z;
All_B = All_B-y+z;
arc.1 = (Uti_A, @+1);
arc.2 = (Uti_B, @+1);
arc.3 = 2y;
arc.4 = 2z;
if ( M(p.6, t) < 3) { arc.6 = (1, @+3) } else { arc.6 = (0, @+3) }
}
if ( Utility(u_a, All_A-y+z) > Uti_A && Utility(u_b, All_B+y-z) > Uti_A )
{
Uti_A = Utility(u_a, All_A-y+z);
Uti_B = Utility(u_b, All_B+y-z);
All_A = All_A-y+z;
All_B = All_B+y-z;
arc.1 = (Uti_A, @+1);
arc.2 = (Uti_B, @+1);
arc.3 = 2z;
arc.4 = 2y;
if ( M(p.6, t) < 3) { arc.6 = (1, @+3) } else { arc.6 = (0, @+3) }
}
else {
arc.1 = Uti_A;
arc.2 = Uti_B;
arc.3 = y + z;
arc.4 = y + z;
arc.6 = (-1, @+3);
}
@ ++;
Simulation model with Petri Net
Simulation model with Petri Net
The sequence beside show
the reachability tree of the
Petri Net previously shown.
We consider a three-
commodities – two - agents
economy with the following
initial condition.
A given marking is
reachable from the initial
marking if exists a
sequence of firings that
transform the initial
marking into it.
1] 6, [8, =
11] 7, [5, =
50] 110, [150, =
140] 250, [100, =
b
a
b
a
u
u
e
e
Java implementation
We implemented the simulation model in Java, a programming language
originally developed by James Gosling at Sun Microsystems. There were
five primary goals in the creation of the Java language:
- It should be "simple, object oriented, and familiar".
- It should be "robust and secure".
- It should be "architecture neutral and portable".
- It should execute with "high performance"
We use a Netbeans Integrated Development Environment to interpret the Java code
and run it in Windows Environment. An Integrated Development Environment is a
software application that provides comprehensive facilities for software development
and usually consists of:
- a source code editor;
- a compiler and/or an interpreter;
- build automation tools;
- a debugger;
The NetBeans Integrated Development
Environment is written in Java and runs
everywhere with a JVM.
We implemented two java classes:
Java implementation
- public class RepeatedGame { . . . }
- public static void main(String[] args) { . . . }
The result shown beside allow a quick
understanding of the improvement the
players get after the trading are carried out.
Experimental design
X1: Correlation between utility and quantity of the same agent :
+ : mean correlation higher then 0.7;
•: mean correlation within [-0.4 , 0.4];
-: mean correlation lower then -0.7 .
X2> Correlation between utility and quantity of the opposite agents:
+ : mean correlation higher then 07.;
•: mean correlation within [-0.4 , 0.4];
-: mean correlation lower then -0.7 .
We use a two-factors-three-levels experiment (3
2
factorial designs) with four replications for
each combination of them to check whether the number of trades needed to reach a Pareto
efficient allocation depends on the correlation between utility and quantity of the initial
endowment.
) N(0, ~
2
2 1 12 2 2 1 1 0
o c
c | | | |
k
k k k k k k
x x x x y + + + + =
A factorial design of
experiment consists of
two or more factors,
each with discrete
possible values or
"levels", and whose
experimental units
take on all possible
combinations of these
levels across all such
factors.
X1 X2 Responces
+ + 45 41 36 31
+ • 35 5 6 4
+ - 33 3 1 2
• + 25 48 5 71
• • 1 21 1 20
• - 11 8 1 2
- + 69 82 198 103
- • 43 21 36 51
- - 2 20 5 20
Data are collected in the following table where each row has 4 observations of the number of
trades needed to reach a Pareto efficient allocation for each combination of factors. The idea is
that there are many possible initial allocations which can fulfill the definition of a factor
combination (i.e. many integer allocations could have mean correlation higher then 0.7 between
utility and quantity of the same agent and mean correlation higher then 0.7 between utility and
quantity of opposite agents). Among then we randomly select fours, which constitute four
distinct replications for the same combination of factors.
Experimental design
The number of replications has been
calculated as follwos
Experimental design
Effect Estimate Stand.Err t.value p.value
intercept 30.444 4.355 6.991 6.39e-08 ***
X1 - 16.583 5.334 - 3.109 0.00392 **
X2 27.333 5.335 5.125 1.38e-05 ***
X1*X2 - 18.812 6.533 - 2.880 0.00704 **
By maximum likelihood,
we obtain the following
estimation of the effects
and the associated
p.values.
The following two plots suggest the presence of a quadratic effect of X1 (Correlation between
utility and quantity of the same agent ). Instead, the evvect of X2 over the responce seems to be
linear. Nonetheless, ti could be reasonable to think that such a curvature could be explained by
the interaction between X1 and X2.
Conclusions and Results
-The correlation between utility and quantity of the same agent is affecting the number
of movements of the Local Search needed to reach a Pareto efficient allocation.
- Also the correlation between utility and quantity of opposite agents has a significative
effect on the response. The underlying idea is that the more preferences of agents match
their respective allocations the closer they are to a Pareto efficient allocation. Conversely,
the more preference of an agent matches with the allocation to the opposite agent the
more it is likely that they have both a convenience in carrying out a movement.
- We also observe something that is less intuitive; that is, the effect of both factors on the
response is not additive: there exists a signifivative interaction between the factors.

1) 2) 3) 4) 5) 6) Bargaining problem The associated Game Simulation model with Petri Net Java implementation Experimental design Conclusions and Results .

x 2 ) 1 2 3  s.  (1 1 1 1 max u ( x1 . Such a problem has been modelled from different outlooks and still represents a source of uncertainty in Social Science and Decision Theory.Bargaining problem The k-lateral bargaining problem concerns the ways k agents cooperate when noncooperation leads to Pareto-inefficient output in the allocation of a fixed quantity. x 2 . . The related bargaining problem consists in finding two new points which keep untouched the overall amount of endowments. x3 ) max u ( 2 ( x 2 . x 2 .t.  1 2 1 2  x 1  x 1  e1  e1  1 2 1 2  x 2  x 2  e2  e2  1 2 1 2  x 3  x 3  e 3  e3  xi  0 j  Suppose two agents are endowed with two respective points in the 3-dimensional commodity space and utility function which represents their preference relation has been defined.

. u1 > t2}. . The solution proposed by Nash considers the compact and convex payoff space P = {(u1.independence of irrelevant alternatives. and a set H of non-dominated vectors of P.Pareto efficiency.invariant to affine transformations. where (t1. t2) is the vector of disagreement payoff. . Nash suggested that a solution should fulfil certain conditions: -symmetry. . u2)| u1 > t1.Bargaining problem As far as the determination of a unique solution is concerned.

j) be an element of such a set of ordered pares. Then. x j   ' ) ] 1 2 [ Utility ( yi . y j   ' ). y j ). Utility ( xi   . The first element (i. Utility ( xi   .The associated Game Consider a lexicographic order in the Cartesian product of the commodities type.j) is selected and an intermediary chooses within three actions: [ Utility ( yi   . x j ). y j   ' ). x j   ' ) ] 1 2 [ Utility ( yi   . x j ) ] 1 2 The payoff function of the intermediary is the following 1 payoff(ω)   0 if ω isn' t Pareto dominated by [Utility 1 ( xi . a sequential game is defined as follows. Utility ( xi . y j )] otherwise . Let (i. Utility 2 ( yi .

y j   ' ). x j ) ]. . Utility ( xi . If the third 1 2 strategy has been chosen.x j ) ] 1 2 Then the two agent sequentially choose whether to accept the proposal. then the second couple of good (i. y j   ' ). x j   ' ) ] 1 2 [ Utility ( yi   . Utility ( xi . y j ). Utility ( xi   . y j ). Utility ( xi   .j) is selected and the intermediary must chosen again between [ Utility ( yi   . in accordance with their associated utility functions. . x j   ' ) ] 1 2 and [ Utility ( yi .The associated Game The intermediary proposes exactly that trade which isn’t Pareto-dominated by [ Utility ( yi .

1 at initial marking. The first transaction to fire is t. Then.2 because it is the unique with @=0. Each token has a timestamp. which is a particular color used to specify the earliest time when it can be consumed. the clock will be updated as @++ so that t. In an economy with three commodities there will be 4 tokens in p.Simulation model with Petri Net We used a Colored Timestamp Petri Net.1.1 will fire since the timestamps associated to its incoming tokens are @ = 1. The transition consumes @ units firing time. The clock is again updated (clock = 2) and the next transaction to fire will be t. which is the value of the current clock. .

arc.1 = (Uti_A. All_B+y-z) > Uti_A ) { Uti_A = Utility(u_a. if ( M(p. . arc.2 = Uti_B. Uti_B = Utility(u_b. All_B-y+z) > Uti_A ) { Uti_A = Utility(u_a. t) < 3) { arc. arc. All_A+y-z) > Uti_A && Utility(u_b.6. @+3). arc. i = 1.2 = (Uti_B. Iterations++. arc. @+3) } else { arc. All_B = All_B-y+z.6 = (1.6. arc. @+1). @+1).1 = (Uti_A. All_A-y+z). arc. arc. All_A-y+z) > Uti_A && Utility(u_b.Simulation model with Petri Net if ( Utility(u_a.3 = y + z. @+3) } } if ( Utility(u_a. Uti_A = all amount. @+1). @ ++. true. @+3) } } else { arc.4 = 2y. arc. } @ ++. t) < 3) { arc.3 = 2z.6 = (1. Uti_B = Utility(u_b. @ ++. arc. All_B-y+z). if ( M(p. arc.6 = (0. @+3) } else { arc. All_B+y-z).6 = (-1.6 = (0. All_A = All_A-y+z. @+1). arc.1 = Uti_A.4 = 2z. All_A = All_A+y-z. All_B = All_B+y-z.3 = 2y.2 = (Uti_B. All_A+y-z).4 = y + z.

110. . We consider a threecommodities – two . e a = [100. 6. 250.Simulation model with Petri Net The sequence beside show the reachability tree of the Petri Net previously shown. 7. 140] eb = [150. 50] u a = [5. 1] A given marking is reachable from the initial marking if exists a sequence of firings that transform the initial marking into it.agents economy with the following initial condition. 11] u b = [8.

An Integrated Development Environment is a software application that provides comprehensive facilities for software development and usually consists of: a source code editor. It should execute with "high performance" We use a Netbeans Integrated Development Environment to interpret the Java code and run it in Windows Environment. a debugger. a programming language originally developed by James Gosling at Sun Microsystems. and familiar". build automation tools.Java implementation We implemented the simulation model in Java. . a compiler and/or an interpreter. It should be "robust and secure". There were five primary goals in the creation of the Java language: - It should be "simple. object oriented. It should be "architecture neutral and portable".

We implemented two java classes: . } . . .Java implementation The NetBeans Integrated Development Environment is written in Java and runs everywhere with a JVM.public class RepeatedGame { . .public static void main(String[] args) { . . } The result shown beside allow a quick understanding of the improvement the players get after the trading are carried out. .

0. y k   0   1 x1k   2 x 2 k   12 x1k x 2 k   k  k ~ N(0. X2> Correlation between utility and quantity of the opposite agents: + : mean correlation higher then 07.Experimental design We use a two-factors-three-levels experiment (32 factorial designs) with four replications for each combination of them to check whether the number of trades needed to reach a Pareto efficient allocation depends on the correlation between utility and quantity of the initial endowment.4].7 . -: mean correlation lower then -0. •: mean correlation within [-0. A factorial design of experiment consists of two or more factors.. and whose experimental units take on all possible combinations of these levels across all such factors.  2 ) X1: Correlation between utility and quantity of the same agent : + : mean correlation higher then 0.7. each with discrete possible values or "levels". -: mean correlation lower then -0. 0. .4 .7 .4]. •: mean correlation within [-0.4 .

The idea is that there are many possible initial allocations which can fulfill the definition of a factor combination (i.Experimental design Data are collected in the following table where each row has 4 observations of the number of trades needed to reach a Pareto efficient allocation for each combination of factors. many integer allocations could have mean correlation higher then 0.7 between utility and quantity of opposite agents). X1 + + + • • • - X2 + • + • + • 45 35 33 25 1 11 69 43 2 Responces 41 5 3 48 21 8 82 21 20 36 6 1 5 1 1 198 36 5 31 4 2 71 20 2 103 51 20 The number of replications has been calculated as follwos . Among then we randomly select fours. which constitute four distinct replications for the same combination of factors.e.7 between utility and quantity of the same agent and mean correlation higher then 0.

333 4. the evvect of X2 over the responce seems to be linear.991 .38e-05 *** X1*X2 .value intercept X1 X2 30.00704 ** .00392 ** 1.334 5. Effect Estimate Stand.39e-08 *** 0.444 .109 5.2.16.583 27. ti could be reasonable to think that such a curvature could be explained by the interaction between X1 and X2. By maximum likelihood.335 6.355 5.812 6.880 0. we obtain the following estimation of the effects and the associated p.value p.values. Instead.Experimental design The following two plots suggest the presence of a quadratic effect of X1 (Correlation between utility and quantity of the same agent ).125 6.3. Nonetheless.18.533 .Err t.

the effect of both factors on the response is not additive: there exists a signifivative interaction between the factors. the more preference of an agent matches with the allocation to the opposite agent the more it is likely that they have both a convenience in carrying out a movement. . . The underlying idea is that the more preferences of agents match their respective allocations the closer they are to a Pareto efficient allocation.Conclusions and Results -The correlation between utility and quantity of the same agent is affecting the number of movements of the Local Search needed to reach a Pareto efficient allocation.We also observe something that is less intuitive. that is. Conversely. .Also the correlation between utility and quantity of opposite agents has a significative effect on the response.