Java Reference
In-Depth Information
ResourceReference is linked to the ResourceAllocator that provides all the
required information about the resource status.
Decision point
How do we modify the preferences when resources are booked?
The booking of the resources after a successful negotiation is not auto-
matically ensured by the framework. Thus when customizing the framework
it is mandatory to provide a class that is responsible for booking the resource.
Usually such a class is the one that creates the negotiator. This class is
responsible for booking the resource with the ResourceAllocator and for recal-
culating the preferences based on the new availability of the resources.
The preferences are computed with the goal of giving preference to
scarcely requested resources in order to distribute reservations as uniformly
as possible over the resources.
The rank of a value of an attribute is proportional to the availability of that
value. The rank 1 is assigned to the value having the maximum availability.
The availability of value
υ
for attribute i is the number of free resources that
have the value
υ
for attribute i , that is:
availability ( i ,
υ
)
=
|
{ resource | free ( resource )
}
resource . attr i = υ
}
|
Equation 20.3 Availability of a value
The weight of each attribute is proportional to the variance of the avail-
ability of the values of each attribute. The weight of attribute i can be
computed using Equation 20.4. The rationale for this choice is that higher
weight is assigned to attributes that have scarcely available values (where
σ 2
is the variance of the availability of attribute i for all the possible values):
2
i
σ
w i =
2
j
j   σ
Equation 20.4 Weight of attribute
The sequence diagram in Figure 20.8 shows the evolution of the pref-
erences for limited resources. Initially the ResourceAllocator creates the
service provider's preferences for the initial state of the resources. Then the
mediator drives the negotiation that must be followed by the booking of a
resource (if successful); after the resource is booked the preferences can be
recomputed on the basis of the new resource availability.
20.5.3
Implementation
The package booking contains all the classes that implement the manage-
ment of limited resources. The class Resource describes the availability of a
 
Search WWH ::




Custom Search