• No se han encontrado resultados

Before we formally define radar in detail in Chapter4, we first illustrate the application of radar on two examples: first is a simple, complete but illustrative example about refactoring the architecture of a system. The second example is the design of a public bike sharing system previously described in Section3.2.

3.4.1 Example 1: Software Architecture Refactoring

Imagine having to perform a cost-benefit analysis for deciding whether to re-factor the architecture of an existing application. With the current architecture, the application generates relatively predictable benefits. Refactoring creates the possibility of generating much higher benefits, but the refactoring costs and benefits are highly uncertain.

A radar model for this decision problem might look like this:

1 Model Refactoring;

2 Objective Max ENB = EV(NB);

3 Objective Min LP = Pr(NB < 0);

4 NB = Benefit − Cost;

5 Cost = decision(“Architecture choice”){

6 “As-is” : deterministic(0);

7 “Refactoring” : normalCI(1, 5);

8 }

9 Benefit = decision(“Architecture choice”){

10 “As-is” : normalCI(0.9, 1.1);

11 “Refactoring” : normalCI(1, 9);

12 }

The language keywords are in bold. The first line declares the name of the model prob-lem. The next two lines define the optimisation objectives: maximising expected net benefit (ENB) and minimising loss probability (LP). The function EV denotes the ex-pected value (or mean) of a random variable and Pr denotes the probability of a Boolean expression. The model’s fourth line then defines net benefit (NB) as the difference be-tween benefit and cost.

The next four lines state that cost depends on the architectural choice. The decision keyword expresses alternative options at decision points in which only a single option can be selected. If the choice is to keep the as-is architecture, we assume the cost to be zero. The deterministic keyword means we believe this cost to be certain. If the choice is to refactor, we believe the cost has a 90% chance of being between £1m and £5m.

The expression normalCI(1, 5) means the cost follows a normal distribution whose 90%

confidence interval is between 1 and 5. Similarly, the last four lines state that benefit depends on the architecture choice and records our beliefs about the benefit’s likelihood for the as-is and refactored architecture.

Probabilities in our approach are Bayesian; probability distributions denote the decision makers’ beliefs about the likelihood of uncertain quantities and events. These beliefs can be informed by subjective judgements, objective data, or a combination of both.

Bayesian methods typically start with probability distributions informed by subjective judgements alone, then update the distributions (using Bayes rule) as new data and information becomes available [275].

Reliable methods exist for eliciting a person’s beliefs about uncertain quantities or events, and model these beliefs as probability distributions [191]. A recommended simple ap-proach consists in eliciting 90% confidence interval as used above [136]. For these elici-tation methods to be reliable, people providing estimations have to be ’calibrated’ on a set of estimation exercises intended to mitigate their under- or over-confidence biases.

3.4.2 Example 2: Design of a Bike Sharing System

Below is a partial decision model developed for the bike sharing system example using radar’s modelling language. This model consists of decisions with single and multiple option selections. It also includes constraints relationships between options of decisions.

The remaining model is presented in Chapter7.2.5.

1 Model BSS;

2 Objective Max ExpectedNetBenefit = EV(NB);

3 Objective Min LossProbability = Pr(NB < 0);

4 NB = Benefit − Cost;

// Lines omitted represent equations for system’s Benefit 60 Cost = CostOfBikes

61 + CostOfSecuringBicycles 62 + CostOfDockStations 63 + CostOfSystemAccessMgt 64 + CostSystemRegistrationMgt 65 + CostOfOtherComponents;

66 CostOfBikes = (NbrBikesToDeploy - NbrBikesDeployed) * UnitCost;

67 NbrBicyclesToDeploy = triangular(500, 550, 600);

68 NbrOfBicyclesCurrentlyDeployed = deterministic(500);

69 UnitCost = decision (“Bike Manufacturer Brand”){

70 “A-Bike”: normalCI(80 ,100);

71 “Bianchi” : normalCI(200 ,300);

72 “Cortina Cyclese”: normalCI(100 ,150);

73 “Derby Cycle”: normalCI(140, 200);

74 “Catrike” : normalCI(250 ,350);

}

75 CostOfSecuringBikes=decision-subset(+)(“Bikes Security”){

76 “Anti-theft feature” : normalCI(1,5);

77 “Localisation feature” : CostOfLocalisation;

78 }

79 CostOfLocalisation=decision-subset(+)(“Tracking Mechanism”){

80 “GPS feature” : normalCI(5,10);

81 “RFID feature” : normalCI(2, 7);

82 }

83 CostOfDockStations = decision (“Dock Station”){

84 “Permanently Fixed” : triangular(25,30, 35);

85 “Temporarily Fixed ” : triangular(30,35,40);

86 “Flexible ” : triangular(30,40,50);

87 }

88 CostOfSysAccessMgt = decision-subset(+)(”Access Management”){

89 “Smart card” : triangular(30,35, 40);

90 “Smart Phone” : triangular(25, 30,35);

91 “Key Card” : triangular(35, 40,45);

92 }

93 CostSysRegMgt = decision-subset(+)(“Registration Management”){

94 “Kisok Reg” : CostOfKioskReg;

95 “Dock Station Reg” : triangular(28, 30,32);

96 “Web Reg” : triangular(30, 40,50);

97 }

98 CostOfKioskReg = decision-subset(+)(”Kisok Registration”){

99 “Touch Screen” : triangular(10, 15, 20);

100 “Key card reader” : triangular(15, 20,25);

101 “Credit Card” : triangular(20, 22,25);

102 “Card Dispenser” : triangular(20, 25, 30);

103 }

104 CostOfOtherComponents =

105 decision-subset(+)(“Non Mandatory Component”){

106 “System Status Info” : CostOfStatusInfo;

107 “Bike Maintenance” : triangular(8,10, 12);

108 “Bike Redistribution” : CostOfRedistribution;

109 }

110 CostOfStatusInfo = decision-subset(+)(”System Status”){

111 “Real Time Web Info” : triangular(35,40, 55);

112 “Real Time Mobile App Info” : triangular(50, 80, 100);

113 }

114 CostOfRedistribution =

115 RedistributionCostWithoutReward + CostForRewardingUsers;

116 RedistributionCostWithoutReward = normalCI(8, 10);

117 CostForRewardingUsers = decision(”Reward Users”){

118 “Without reward” : deterministic(0);

119 “With Reward” : deterministic(10);

120 }

121 Constraint “Bike Manufacturer Brand” : “A-Bike” excludes 122 “Tracking Mechanism ”: “GPS feature”;

123 Constraint “Kiosk Registration” : “Card Dispenser” couples 124 “System Access Management”: “Key Card”;

125 Constraint “System Access Management” : “Key Card” requires 126 “Kiosk Registration” : “Key card reader”;

In the bike sharing model described above, lines 2 and 3 declare the model objectives:

the first objective is a maximisation of the expected net benefit of the system (Ex-pectedNetBenefit) and the second objective is a minimisation of the loss probability (LossProbability).

Line 4 states that the net benefit is benefit minus cost. Lines 60 to 65 state that the total cost is the sum of the cost of different system components. Lines 66 states that the cost of bikes is the product of the unit cost of a bike and the difference between the number of bikes to deploy and the number of bikes already deployed.

In line 67, the expression triangular(500, 550, 600) means that the decision-maker believes the number of additional bikes to deploy (NbrBikesToDeploy) is between 500 and 600, with a likely value of 550. Line 68 states that the decision-maker knows with certainty that the number of bikes currently deployed (NbrOfBikesCurrentlyDeployed) is 500.

In lines 69 to 74, the keyword decision expresses a decision with single option selec-tion. The expression states that the unit cost of a bike (UnitCost) depends on the bike manufacturer brand. If the choice is to purchase the A-Bike brand, the cost is believed to be between £80 and £100, and if the choice is to purchase the Bianchi brand, the

cost is believed to be between £200 and £300. Similar interpretations can be made if the option is to purchase Cortina Cyclese brand, Derby Cycle brand, or Catrike brand.

Also, in lines 78 to 82 the keyword decision-subset expresses a decision with multiple option selections. The expression states that the cost of bike localisation depends on the tracking mechanism. Zero cost is incurred if none of the tracking mechanism is selected. However, if the choice is to select only the GPS option, the cost is believed to be between £5m and £10m; if the choice is to select only the RFID option, the cost is believed to be between £2m and £7m. Finally, if the choice is to select both GPS and RFID options, the cost is the sum of the individual cost incurred by implementing each feature separately. We added the costs because of the ‘+’ operator in the expression.

Lines 121 to 126 declare the constraint relationships in the problem using the keyword Constraint . The constraint expressions state that a bike of brand “A-Bike” does not support the GPS feature; the card dispenser option of the Kiosk registration and the key card option of the systems access management must be implemented together; and the key card option of the kiosk registration requires a key card reader.

3.5 Visualising AND/OR Refinements and Decision

Documento similar