Android Phone Example with four Objectives

Back to Introduction

Here’s a simple example of a model suitable for optimization using ClaferMoo. In order to analyze the model and explore the Pareto front in ClaferMoo Visualizer, click the link below:


If you’re not sure what you can do in the analyzer, try the following workflow.

In this model, we have a product line of phones that consists of Features and SecurityFeatures. We want to find all optimal configurations of aPhone.

c0_Feature abstract Feature c0_SecurityFeature abstract SecurityFeature : Feature c0_SecurityFeature->c0_Feature c0_MobilePhone abstract MobilePhone c0_MobilePhone->c0_Feature c0_MobilePhone->c0_Feature c0_MobilePhone->c0_Feature c0_MobilePhone->c0_SecurityFeature c0_MobilePhone->c0_SecurityFeature c0_aPhone aPhone : MobilePhone c0_aPhone->c0_MobilePhone

From the graph, we can see that the phone product line consists of four features and two security features.

Modeling the Optimization Problem

First, we need to define features with some quality attributes performance, energy, and mass:

abstract Feature
performance -> integer
energy -> integer
mass -> integer

There’s also a special kind of feature, SecurityFeature, which has another quality attribute security:

abstract SecurityFeature : Feature
security -> integer

Next, we need to write a model of our product line with some variability regarding the features. We need to set the values for quality attributes of each feature.

abstract MobilePhone
or Connectivity
Bluetooth : Feature
[ this.performance = 9 ]
[ this.energy = 10 ]
[ this.mass = 2 ]
USB : Feature
[ this.performance = 10 ]
[ this.energy = 5 ]
[ this.mass = 3 ]
Wifi : Feature
[ this.performance = 22 ]
[ this.energy = 17 ]
[ this.mass = 6 ]
PasswordProtection : SecurityFeature ?
[ this.security = 5 ]
[ this.performance = 1 ]
[ this.energy = 2 ]
[ this.mass = 0 ]
FingerprintProtection : SecurityFeature ?
[ this.mass = 0 ]
[ this.security = 5 ]
[ this.performance = 2 ]
[ this.energy = 4 ]
total_performance -> integer = sum Feature.performance
total_energy -> integer = sum Feature.energy
total_security -> integer = sum SecurityFeature.security
total_mass -> integer = sum Feature.mass

Next, we define our product aPhone.

aPhone : MobilePhone

The product is underspecified allowing for all possible valid combinations of features.

Finally, we define the following four optimization goals.

“Minimize total energy”:

<<minimize aPhone.total_energy>>

“Maximize total performance”:

“Minimize total mass”:

<<minimize aPhone.total_mass>>

“Maximize total security”:

<<maximize aPhone.total_security>>

In order to analyze the model and explore the Pareto front in ClaferMoo Visualizer, click the link below: