// Path: ensemble-clustering/src/main/java/com/oculusinfo/ml/feature/temporal/TemporalFeature.java
// public class TemporalFeature extends Feature {
// 	private static final long serialVersionUID = 679871263379162267L;
// 	private Date start;
// 	private Date end;
// 	
// 	@Override
// 	public String toString() {
// 		return (this.getName() + ":[" + start + "; " + end + "]");
// 	}
// 	
// 	public TemporalFeature() {
// 		super();
// 	}
// 	
// 	public TemporalFeature(String name) {
// 		super(name);
// 	}
// 	
// 	public void setValue(Date start, Date end) {
// 		this.start 	= start;
// 		this.end 	= end;
// 	}
// 	
// 	public Date getStart() {
// 		return start;
// 	}
// 	
// 	public void setStart(Date start) {
// 		this.start = start;
// 	}
// 	
// 	public Date getEnd() {
// 		return end;
// 	}
// 	
// 	public void setEnd(Date end) {
// 		this.end = end;
// 	}
// }


import java.util.List;
import org.junit.Test;
import com.oculusinfo.ml.feature.temporal.TemporalFeature;
import com.oculusinfo.ml.feature.temporal.distance.TemporalDistance;
import static org.junit.Assert.assertTrue;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.LinkedList;
/**
 * Copyright (c) 2013 Oculus Info Inc.
 * http://www.oculusinfo.com/
 *
 * Released under the MIT License.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:

 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.oculusinfo.ml.distance;





public class TestTemporalDistance {

	long MS_PER_DAY = 86400000;
	long MS_PER_WEEK = MS_PER_DAY * 7;
	long MS_PER_MONTH = MS_PER_DAY * 30;
	long MS_PER_YEAR = MS_PER_DAY * 365;
	
	double epsilon = 0.00001;
	
	private boolean isEqual(double d1, double d2) {
		return (Math.abs( d1 - d2 ) < epsilon );
	}
	
	@Test
	public void testIdenticalPoints() {
		Date date = (new GregorianCalendar(2010, 01, 01)).getTime();
		
// Path: ensemble-clustering/src/main/java/com/oculusinfo/ml/feature/temporal/TemporalFeature.java
// public class TemporalFeature extends Feature {
// 	private static final long serialVersionUID = 679871263379162267L;
// 	private Date start;
// 	private Date end;
// 	
// 	@Override
// 	public String toString() {
// 		return (this.getName() + ":[" + start + "; " + end + "]");
// 	}
// 	
// 	public TemporalFeature() {
// 		super();
// 	}
// 	
// 	public TemporalFeature(String name) {
// 		super(name);
// 	}
// 	
// 	public void setValue(Date start, Date end) {
// 		this.start 	= start;
// 		this.end 	= end;
// 	}
// 	
// 	public Date getStart() {
// 		return start;
// 	}
// 	
// 	public void setStart(Date start) {
// 		this.start = start;
// 	}
// 	
// 	public Date getEnd() {
// 		return end;
// 	}
// 	
// 	public void setEnd(Date end) {
// 		this.end = end;
// 	}
// }


// Path: ensemble-clustering/src/test/java/com/oculusinfo/ml/distance/TestTemporalDistance.java
import java.util.List;
import org.junit.Test;
import com.oculusinfo.ml.feature.temporal.TemporalFeature;
import com.oculusinfo.ml.feature.temporal.distance.TemporalDistance;
import static org.junit.Assert.assertTrue;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.LinkedList;

/**
 * Copyright (c) 2013 Oculus Info Inc.
 * http://www.oculusinfo.com/
 *
 * Released under the MIT License.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:

 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.oculusinfo.ml.distance;





public class TestTemporalDistance {

	long MS_PER_DAY = 86400000;
	long MS_PER_WEEK = MS_PER_DAY * 7;
	long MS_PER_MONTH = MS_PER_DAY * 30;
	long MS_PER_YEAR = MS_PER_DAY * 365;
	
	double epsilon = 0.00001;
	
	private boolean isEqual(double d1, double d2) {
		return (Math.abs( d1 - d2 ) < epsilon );
	}
	
	@Test
	public void testIdenticalPoints() {
		Date date = (new GregorianCalendar(2010, 01, 01)).getTime();
		
		TemporalFeature t1 = new TemporalFeature();