Package infosapient.resolution

Source Code of infosapient.resolution.FzyResMAXIMUM

package infosapient.resolution;
/*
* 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;
/**
  * Take the highest point. If it is a plateau, take the first in the plateau.
   * @author: Michael McConnell
   * @version $Revision: 1.1.1.1 $
  
   *
   */
public class FzyResMAXIMUM extends FzyResolutionMethod
{
  static final long serialVersionUID = -612495323383468223L;
  double domainValue;
  double dom;
  public FzyResMAXIMUM() {myID = new ObjID();}
  public String getName() { return "maximum"; }
/**
*
*/
public synchronized double resolveUsing(FzySet fset) {
  double[] membership = fset.getMemberArray();
  double x = -1.0;
  int i, j, k;
  i = j = k = 0;
  for (i = 0; i < membership.length; i++)
    if (membership[i] > x) {
      x = membership[i];
      k = i;
    }
  for (j = k + 1; j < VECMAX; j++) {
    if (membership[j] != x)
      break;
  }

  indexForDefuzz = (int) (((double) j - (double) k) / 2);

  if (indexForDefuzz == 0)
    indexForDefuzz = k;
  domainValue = fset.getDomain(indexForDefuzz);
  dom = fset.getMembership(indexForDefuzz);
  return domainValue;
}
}
TOP

Related Classes of infosapient.resolution.FzyResMAXIMUM

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.