Package infosapient.hdg

Source Code of infosapient.hdg.FzyHdgGENERALLY

package infosapient.hdg;
/*
* Copyright (c) 2001, Workplace Performance Tools, All Rights Reserved.
*
* LICENSE TO USE THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE 0.5
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
* The license may be viewed at:
* http://www.opensource.org/licenses/cpl.html
*/
import infosapient.system.FzySet;
import java.rmi.server.ObjID;
/**
* Hedge GENERALLY does the following for each membership value:
* <code>
*    if (m[inx] >= 0.5d) {
*      newMembership[inx] = 0.8 * Math.sqrt(m[inx]);
*    } else {
*      newMembership[inx] = 1.0 - (0.8 * Math.sqrt(1.0 - m[inx]));
*    }</code>
*/
public  class FzyHdgGENERALLY extends FzyHedge {
  static final long serialVersionUID = -885660899294081991L;
  public FzyHdgGENERALLY() {myID = new ObjID();}
  public FzySet apply(FzySet aSet) {
    double cutOff = 0.5d;
    VECMAX = aSet.getMemberArray().length;
    m = new double[VECMAX];
    results = new double[VECMAX];
    m = aSet.getMemberArray();

    for (int inx = 0; inx < VECMAX; inx++ ) {

      if (m[inx] >= cutOff) {
        results[inx] = 0.8 * Math.sqrt(m[inx]);
      } else {
        results[inx] = 1.0 - (0.8 * Math.sqrt(1.0 - m[inx]));
      }
    }
    aSet.setMembershipArray(results);
    return aSet;
  }
  public String getName() { return "generally"; }
}
TOP

Related Classes of infosapient.hdg.FzyHdgGENERALLY

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.