es.ants.felixgm.trmsim_wsn.trm.lftm
Class LFTM_Service

java.lang.Object
  extended by es.ants.felixgm.trmsim_wsn.network.Service
      extended by es.ants.felixgm.trmsim_wsn.trm.lftm.LFTM_Service

public class LFTM_Service
extends Service

This class models a service offered in a P2P, Ad-hoc or Wireless Sensor Network, or even an agent in a multi-agent system. Its several attributes (price, quality, deliveryTime, etc.) are defined through fuzzy sets (Variables)

Since:
0.4
Version:
0.4
Author:
Félix Gómez Mármol, Gregorio Martínez Pérez

Field Summary
protected  Variable cost
          Service's cost fuzzy set
protected  Variable delivery
          Service's delivery time fuzzy set
protected  FuzzyRuleSet frsCost
          Fuzzy rules set used to compare the cost of two services
protected  FuzzyRuleSet frsDelivery
          Fuzzy rules set used to compare the delivery time of two services
protected  FuzzyRuleSet frsPrice
          Fuzzy rules set used to compare the price of two services
protected  FuzzyRuleSet frsQuality
          Fuzzy rules set used to compare the quality of two services
protected  Variable price
          Service's price fuzzy set
protected  Variable quality
          Service's quality fuzzy set
protected  double U_MAX
          Universe MAX.
protected  double U_MIN
          Universe MIN.
 
Fields inherited from class es.ants.felixgm.trmsim_wsn.network.Service
id
 
Constructor Summary
LFTM_Service(Service service, java.util.Collection<LinguisticTerm> linguisticTerms, java.lang.String fuzzyPrice, java.lang.String fuzzyCost, java.lang.String fuzzyDelivery, java.lang.String fuzzyQuality)
          Class LFTM_Service constructor
LFTM_Service(java.lang.String id, Variable price, Variable cost, Variable delivery, Variable quality)
          Class LFTM_Service constructor
 
Method Summary
 Service clone()
          This method creates and returns a copy of this service
 Variable compareTo(LFTM_Service service, double prizeWeight, double costWeight, double deliveryWeight, double qualityWeight)
          This method compares two services, by comparing their attributes and returns a fuzzy set representing such comparison.
 Variable get_cost()
          This method returns the service's cost fuzzy set
 Variable get_delivery()
          This method returns the service's delivery time fuzzy set
 Variable get_price()
          This method returns the service's price fuzzy set
 Variable get_quality()
          This method returns the service's quality fuzzy set
 
Methods inherited from class es.ants.felixgm.trmsim_wsn.network.Service
equals, id, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

U_MIN

protected final double U_MIN
Universe MIN. Minimum value for the fuzzy sets used in this class


U_MAX

protected final double U_MAX
Universe MAX. Maximum value for the fuzzy sets used in this class


price

protected Variable price
Service's price fuzzy set


frsPrice

protected FuzzyRuleSet frsPrice
Fuzzy rules set used to compare the price of two services


cost

protected Variable cost
Service's cost fuzzy set


frsCost

protected FuzzyRuleSet frsCost
Fuzzy rules set used to compare the cost of two services


delivery

protected Variable delivery
Service's delivery time fuzzy set


frsDelivery

protected FuzzyRuleSet frsDelivery
Fuzzy rules set used to compare the delivery time of two services


quality

protected Variable quality
Service's quality fuzzy set


frsQuality

protected FuzzyRuleSet frsQuality
Fuzzy rules set used to compare the quality of two services

Constructor Detail

LFTM_Service

public LFTM_Service(Service service,
                    java.util.Collection<LinguisticTerm> linguisticTerms,
                    java.lang.String fuzzyPrice,
                    java.lang.String fuzzyCost,
                    java.lang.String fuzzyDelivery,
                    java.lang.String fuzzyQuality)
Class LFTM_Service constructor

Parameters:
service - Service to "fuzzify"
linguisticTerms - Set of linguistic terms applied in the fuzzy sets representing this service attributes (price, quality, etc.)
fuzzyPrice - Price fuzzy value ("Very High", "High", etc.)
fuzzyCost - Cost fuzzy value ("Very High", "High", etc.)
fuzzyDelivery - Delivery time fuzzy value ("Very High", "High", etc.)
fuzzyQuality - Quality fuzzy value ("Very High", "High", etc.)

LFTM_Service

public LFTM_Service(java.lang.String id,
                    Variable price,
                    Variable cost,
                    Variable delivery,
                    Variable quality)
Class LFTM_Service constructor

Parameters:
id - Services's identifier
price - Fuzzy set representing the price of this service
cost - Fuzzy set representing the cost of this service
delivery - Fuzzy set representing the delivery time of this service
quality - Fuzzy set representing the quality of this service
Method Detail

compareTo

public Variable compareTo(LFTM_Service service,
                          double prizeWeight,
                          double costWeight,
                          double deliveryWeight,
                          double qualityWeight)
This method compares two services, by comparing their attributes and returns a fuzzy set representing such comparison. Each attribute is weighted with a given weight. If service1.compareTo(service2) output is, for instance, "Very High", it means that "service1 is much better than service2"

Parameters:
service - Service to be compared with this service
prizeWeight - Price weight
costWeight - Cost weight
deliveryWeight - Delivery time weight
qualityWeight - Quality weight
Returns:
A fuzzy set representing the comparison between this service and the given one

clone

public Service clone()
Description copied from class: Service
This method creates and returns a copy of this service

Overrides:
clone in class Service
Returns:
A copy a this service

get_price

public Variable get_price()
This method returns the service's price fuzzy set

Returns:
The service's price fuzzy set

get_cost

public Variable get_cost()
This method returns the service's cost fuzzy set

Returns:
The service's cost fuzzy set

get_delivery

public Variable get_delivery()
This method returns the service's delivery time fuzzy set

Returns:
The service's delivery time fuzzy set

get_quality

public Variable get_quality()
This method returns the service's quality fuzzy set

Returns:
The service's quality fuzzy set