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 FzyHdgPOSITIVE examines each truth membership value to see if it is
* above or below the 0.5 test.
* @author: Michael McConnell
* @version $Revision: 1.1.1.1 $
*/
public class FzyHdgPOSITIVE extends FzyHedge {
static final long serialVersionUID = 2045860147997434477L;
public FzyHdgPOSITIVE() {myID = new ObjID();}
public FzySet apply(FzySet aSet) {
double half = 0.5d;
m = aSet.getMemberArray();
for (int inx = 0; inx < VECMAX; inx++) {
if (m[inx] > half)
results[inx] = Math.pow(m[inx], 2.0d);
else
results[inx] = 1.0 - ( 2.0 * Math.pow((1.0 - m[inx]), POSITIVE_EXP));
}
aSet.setMembershipArray(results);
return aSet;
}
public String getName() { return "positive"; }
}