All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.TKnudsen.ComplexDataObject.model.weighting.Integer.BlockKernel Maven / Gradle / Ivy

Go to download

A library that models real-world objects in Java, referred to as ComplexDataObjects. Other features: IO and preprocessing of ComplexDataObjects.

The newest version!
package com.github.TKnudsen.ComplexDataObject.model.weighting.Integer;

/**
 * 

* Title: BlockKernel *

* *

* Description: *

* *

* Copyright: Copyright (c) 2016-2017 *

* * @author Juergen Bernard * @version 1.02 */ public class BlockKernel implements IIntegerWeightingKernel { private Integer reference; private Integer interval; /** * for serialization */ public BlockKernel() { this.interval = 3; } public BlockKernel(Integer interval) { this.interval = interval; } @Override public Integer getInterval() { return interval; } @Override public void setInterval(Integer t) { this.interval = t; } @Override public double getWeight(Integer t) { if (Math.abs(reference - t) > interval) return 0.0; return 1.0; } @Override public Integer getReference() { return reference; } @Override public void setReference(Integer t) { this.reference = t.intValue(); } @Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof BlockKernel)) return false; BlockKernel other = (BlockKernel) o; return other.interval == interval && other.reference == reference; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy