Autonomic Delivery of Expertise Via Web Services
by Michael J. Fichtelman 

Listing One

/**
* This fuzzy ruleset, when given data for BCWS, ACWP and BCWP, will determine 
* a risk rating of * A (good), B (adequate), or C (poor). You may change the 
* values used in the assertion rules, re-verify and re-run the ruleset 
* to determine new risk ratings. 
*/

ruleset RiskEV {
  variables {
    Fuzzy BCWS = new Fuzzy(0, 2000)  {
      Linear    Large  = new Linear  (1000, 2000, ARL.Up);
      Linear    Small  = new Linear  ( 0,  1000, ARL.Down);
      Triangle  Medium = new Triangle( 0,  1000, 2000);
    };
     Fuzzy ACWP = new Fuzzy(0, 2000)  {
      Linear    Large  = new Linear  (1000, 2000, ARL.Up);
      Linear    Small  = new Linear  ( 0,  1000, ARL.Down);
      Triangle  Medium = new Triangle( 0,  1000, 2000);
    };
     Fuzzy BCWP = new Fuzzy(0, 2000)  {
      Linear    Large  = new Linear  (1000, 2000, ARL.Up);
      Linear    Small  = new Linear  ( 0,  1000, ARL.Down);
      Triangle  Medium = new Triangle( 0,  1000, 2000);
    };
     Fuzzy SV = new Fuzzy(-2000, 2000)  {
      Linear    VeryGood  = new Linear  (1000, 2000, ARL.Up);
      Linear    Good  = new Linear  (500, 1000, ARL.Up);
      Linear    Bad  = new Linear  ( -1000,  -500, ARL.Down);
      Linear    VeryBad  = new Linear  ( -2000,  -1000, ARL.Down);
      Triangle  Adequate = new Triangle( -500, 0, 500);
    };
     Fuzzy CV = new Fuzzy(-2000, 2000)  {
      Linear    VeryGood  = new Linear  (1000, 2000, ARL.Up);
      Linear    Good  = new Linear  (500, 1000, ARL.Up);
      Linear    Bad  = new Linear  ( -1000,  -500, ARL.Down);
      Linear    VeryBad  = new Linear  ( -2000,  -1000, ARL.Down);
      Triangle  Adequate = new Triangle( -500, 0, 500);
    };
     Fuzzy SPI = new Fuzzy(0.0, 2.0)  {
      Linear    VeryGood  = new Linear  (1.5, 2.0, ARL.Up);
      Linear    Good  = new Linear  (1.00, 1.5, ARL.Up);
      Linear    Bad  = new Linear  ( 0.5,  0.9, ARL.Down);
      Linear    VeryBad  = new Linear  ( 0.0,  0.5, ARL.Down);
      Triangle  Adequate = new Triangle(0.95, 1.0, 1.05);
    };
     Fuzzy CPI = new Fuzzy(0.0, 2.0)  {
      Linear    VeryGood  = new Linear  (1.5, 2.0, ARL.Up);
      Linear    Good  = new Linear  (1.00, 1.5, ARL.Up);
      Linear    Bad  = new Linear  ( 0.5,  0.9, ARL.Down);
      Linear    VeryBad  = new Linear  ( 0.0,  0.5, ARL.Down);
      Triangle  Adequate = new Triangle( 0.95, 1.0, 1.05);
    };
    Fuzzy RiskRating = new Fuzzy(0.0, 1.0)  {
      Triangle  Medium = new Triangle(0.3, 0.5, 0.65);
      Linear    Low   = new Linear  (0.6, 1.0, ARL.Up);
      Linear    High     = new Linear  (0.0, 0.4, ARL.Down);
    };
    Categorical SymRating = new Categorical(new String[] {"C", "B", "A"});
  }
  //inputs {};
  inputs {BCWS,ACWP,BCWP};
  outputs {BCWS, ACWP, BCWP, CV, SV, SPI, CPI, RiskRating, SymRating};
  // Running this ruleset 
  // produces the following output:
  //     Variable...<BCWS>    Value......<>
  //     Variable...<ACWP>   Value......<>
  //     Variable...<BCWP>   Value......<>
  //     Variable...<CV>  Value......<>
  //     Variable...<SV>      Value......<>
  //     Variable...<CPI>  Value......<>
  //     Variable...<SPI>      Value......<>
  //     Variable...<RiskRating>    Value......<>
  //     Variable...<SymRating> Value......<>

  void init() { 
       : setControlParameter(ARL.process, ARL.CorrelationMethod, ARL.Minimum);
       : setControlParameter(ARL.process, ARL.AlphaCut, 0.01);
  }     
  void process() using Fuzzy { 
    //case 1 Ideal planning, going according to schedule.
    // 
    //A01: BCWS   = 800;
    //A02: ACWP  =  800;
    //A03: BCWP =  800;

    //case 2 One of the worst cases, 50% behind schedule, 
    //                                 cost overrun, project underrunning.
    //A01: BCWS   = 800;
    //A02: ACWP  =  600;
    //A03: BCWP =  400;

    //case 3 Good and bad. Efficiency (CPI) exceeds 100%, but behind schedule.
    // 
    //A01: BCWS   = 800;
    //A02: ACWP  =  400;
    //A03: BCWP =  600;

    //case 4 Good and bad.  Efficiency (CPI) is on track, but 
    //                                       project behind schedule.
    //A01: BCWS   = 800;
    //A02: ACWP  =  600;
    //A03: BCWP =  600;

    //case 5 Good and bad.  Efficiency (CPI) is behind, so project 
    //                        is behind schedule, but costs are on track.
    //A01: BCWS   = 800;
    //A02: ACWP  =  800;
    //A03: BCWP =  600;

    //case 6 , Very Good, 125%  Efficiency (CPI), so project ahead 
    //                                     of schedule, and within costs.
    //A01: BCWS   = 800;
    //A02: ACWP  =  800;
    //A03: BCWP =  1000;

    //case 7 , 100%  Efficiency (CPI), and project ahead of 
    //                                      schedule, and within costs.
    //A01: BCWS   = 800;
    //A02: ACWP  =  1000;
    //A03: BCWP =  1000;

    //case 8 Very Good, 130%  Efficiency (CPI), and project on 
    //                                   schedule, and under budgeted costs
    //A01: BCWS   = 800;
    //A02: ACWP  =  600;
    //A03: BCWP =  800;

    //case 9 Good and bad, 80%  Efficiency (CPI), and project on 
    //                                 schedule, but over budgeted costs
    //A01: BCWS   = 800;
    //A02: ACWP  =  1000;
    //A03: BCWP =  800;

    //case 10 Very bad, 60%  Efficiency( CPI), and project behind 
    //                              schedule, and over budgeted costs.
    //A01: BCWS   = 800;
    //A02: ACWP  =  1000;
    //A03: BCWP =  600;

    //case 11 Very good, 160%  Efficiency (CPI), and project ahead 
    //                             schedule, and under budgeted costs.
    //A01: BCWS   = 800;
    //A02: ACWP  =  600;
    //A03: BCWP =/  1000;

    //case 12 Good and bad, 83%  Efficiency (CPI), and project ahead 
    //                               schedule, but over budgeted costs.
    //A01: BCWS   = 800;
    //A02: ACWP  =  1200;
    //A03: BCWP =  1000;

    //case 13 Good , 120%  Efficiency (CPI), and project very 
    //                       ahead schedule, but over budgeted costs.
    //A01: BCWS   = 800;
    //A02: ACWP  =  1000;
    //A03: BCWP =  1200;

    R1: CV      =  BCWP - ACWP;
    R2: SV      =  BCWP - BCWS;
    R3: CPI  = (BCWP / ACWP);
    R4: SPI = (BCWP / BCWS); 
    
    R05: if (CV is VeryGood ) then RiskRating is Low;
    R06: if (CV is Good ) then RiskRating is Low;    
    R07: if (CV is Adequate ) then RiskRating is Medium;
    R08: if (CV is Bad) then RiskRating is High;
    R09: if (CV is VeryBad ) then RiskRating is High;
    
    R10: if (SV is VeryGood ) then RiskRating is Low;
    R11: if (SV is Good ) then RiskRating is Low;    
    R12: if (SV is Adequate ) then RiskRating is Medium;
    R13: if (SV is Bad) then RiskRating is High;
    R14: if (SV is VeryBad ) then RiskRating is High;
    
    R15: if (SPI is VeryGood ) then RiskRating is Low;
    R16: if (SPI is Good ) then RiskRating is Low;    
    R17: if (SPI is Adequate ) then RiskRating is Medium;
    R18: if (SPI is Bad) then RiskRating is High;
    R19: if (SPI is VeryBad ) then RiskRating is High;
    
    R20: if (CPI is VeryGood ) then RiskRating is Low;
    R21: if (CPI is Good ) then RiskRating is Low;    
    R22: if (CPI is Adequate ) then RiskRating is Medium;
    R23: if (CPI is Bad) then RiskRating is High;
    R24: if (CPI is VeryBad ) then RiskRating is High;

    R25: if (RiskRating is High    ) then SymRating = "C";
    R26: if (RiskRating is Medium) then SymRating = "B";
    R27: if (RiskRating is Low  ) then SymRating = "A";
  }
}






4



