evtsce
- 208766@student.pwr.edu.pl (Unlicensed)
- Dawid Bigaj (Unlicensed)
evtsce <scenario> | |
---|---|
Flag | -s |
Parametr | String: option (comma separated scenario indexes) |
Description | Count probability for scenarios |
Output: success | "Membership Function for scenarioo: [" + option + "]" ... |
Output: fail | "There is no tree" |
- Detailed description
Trapezoidal fuzzy numbers are reprezents by 4 parameters <a, b, c, d>
The function multiplies the parameters of trapezoidal-shaped membership functions of the edges from the specific edge to the root (not including the root) to calculate the probability of the scenario (approximate result).
The function uses this pattern to sum up the probabilities of scenarios:
eventTreeScenarioCounterThis is description of MainCLI function(eventTreeScenarioCounter(String)). In Step2 we started to describe MainAPI function(eventTreeScenarioCounter(String, EventTree)) after MainCLI function constructs 'MembershipFunction' object. In Step3 we are back to MainCLI function(eventTreeScenarioCounter(String)). Step1: The function initializes empty string (e.g. 'outputText'). Step2: The function constructs the 'MembershipFunction' object (e.g. 'mf1') equal api.eventTreeScenarioCounter (argument of described function (e.g. 'option'), eventsTree). 'option' is a string with the scenarios indexes separated by commas. eventTreeScenarioCounter converts separeted scenarios indexes into an integer and assigns it to the new table (e.g. indexes). eventTreeScenarioCounter constructs the 'MembershipFunction' object (e.g. 'mf2') equal null. If (eventsTree == null) eventTreeScenarioCounter returns null Else{ If (size of 'indexes' == 1) eventTreeScenarioCounter counts the probability of scenario from 'option' and assign it to the 'mf2'. Else if (size of 'indexes' > 1){ eventTreeScenarioCounter constructs list of 'MembershipFunction' elements (e.g. 'probab'). eventTreeScenarioCounter counts the probabilities of the scenarios from 'option' and assigns it to the 'probab'. eventTreeScenarioCounter constructs the 'MembershipFunction' object (e.g. 'mf3') equal sumMembershipFunctionsOfScenarios(probab) to sums up the propabilities from the list and assigns it to the 'mf2'. } eventTreeScenarioCounter returns 'mf2'. Step3: If ('mf1' == null) The function assigns "There is no tree" to the 'outputText' and then display it. Else { The function constructs the 'ParamTrapezoid' object (e.g. 'pt'), then gets parametrs from 'mf1' and assigns it to the 'pt'. The function assigns "\nMembership Function for scenario/scenarios: [" + 'option' + "]" plus 4 parameters(taken from 'pt') separeted by "\n" to the 'outputText' and then display it. }