Package infosapient.hdg

Source Code of infosapient.hdg.FzyHdgAFTER

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;

/**

* Class FzyHdgAFTER applies <code>m[i] = 0.0</code> for all domain values below/before
* <code>m[i] == 1.0</code> and <code> m[i] = 1.0 - m[i]</code>
* for all values after/above.
* <p><i> Note: if the set is right shouldered ( 100%membership ==
* highDomain) nothing will occur</i>.
* @author: Michael McConnell
*
*
* @version $Revision: 1.1.1.1 $
*/
public class FzyHdgAFTER extends FzyHedge {
  static final long serialVersionUID = 5021596363450600070L;
  public FzyHdgAFTER() {myID = new ObjID();}
  /**
   * Apply the surface modifier <code>m[i] = 0.0</code> for all domain values below/before
   * <code>m[i] == set.maxHeight()</code> and <code> m[i] = 1.0 - m[i]</code>
   * for all values after/above.
   * @param FzySet -- the set to have the hedge applied to it.
   * @return FzySet -- the modified fuzzy set.
   */
  public FzySet apply(FzySet aSet) {
    VECMAX = aSet.getMemberArray().length;
  results = new double[VECMAX];
  m = aSet.getMemberArray();
  double maxHeight = aSet.getMaxHeight();
  for(int inx = 0 ; inx < VECMAX; inx++){
    if( m[inx] >= maxHeight ) {
    for(int jnx = 0;jnx < VECMAX; jnx++) {
      if(jnx <= inx){
      results[jnx] = 0.0;
      } else {
      results[jnx] = 1.0d - m[jnx];
      }
    }
    break;
    }
  }

  aSet.setMembershipArray(results);
  return aSet;
  }
  public String getName() { return "after"; }
}
TOP

Related Classes of infosapient.hdg.FzyHdgAFTER

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.