// Path: happyresearch/src/main/java/happy/research/cf/TrustRating.java
// public class TrustRating
// {
// 	private String	trustor;
// 	private String	trustee;
// 	private double rating;
// 
// 	public String getTrustor()
// 	{
// 		return trustor;
// 	}
// 
// 	public void setTrustor(String trustor)
// 	{
// 		this.trustor = trustor;
// 	}
// 
// 	public String getTrustee()
// 	{
// 		return trustee;
// 	}
// 
// 	public void setTrustee(String trustee)
// 	{
// 		this.trustee = trustee;
// 	}
// 
// 	public double getRating()
// 	{
// 		return rating;
// 	}
// 
// 	public void setRating(double rating)
// 	{
// 		this.rating = rating;
// 	}
// 
// 	@Override
// 	public String toString()
// 	{
// 		return trustor + " " + trustee + " " + rating;
// 	}
// 	
// }


import happy.research.cf.TrustRating;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

package happy.research.utils;



public class TidalTrust
{

	/**
	 * TidalTrust algorithm to infer trust
	 * 
	 * @param userTNsMap
	 *            {user, {trustors}} map
	 * @param userTrustorsMap
	 * @param userRatingsMap
	 *            {user, {trust ratings}} map
	 * @param source
	 *            source user
	 * @param sink
	 *            target user
	 * @param maxDepth
	 *            maximum length of the searching path
	 * @return
	 */

	@SuppressWarnings({ "unchecked" })
	public static Map<String, Double> runAlgorithm(Map<String, Map<String, Double>> userTrusteesMap,

// Path: happyresearch/src/main/java/happy/research/cf/TrustRating.java
// public class TrustRating
// {
// 	private String	trustor;
// 	private String	trustee;
// 	private double rating;
// 
// 	public String getTrustor()
// 	{
// 		return trustor;
// 	}
// 
// 	public void setTrustor(String trustor)
// 	{
// 		this.trustor = trustor;
// 	}
// 
// 	public String getTrustee()
// 	{
// 		return trustee;
// 	}
// 
// 	public void setTrustee(String trustee)
// 	{
// 		this.trustee = trustee;
// 	}
// 
// 	public double getRating()
// 	{
// 		return rating;
// 	}
// 
// 	public void setRating(double rating)
// 	{
// 		this.rating = rating;
// 	}
// 
// 	@Override
// 	public String toString()
// 	{
// 		return trustor + " " + trustee + " " + rating;
// 	}
// 	
// }


// Path: happyresearch/src/main/java/happy/research/utils/TidalTrust.java
import happy.research.cf.TrustRating;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

package happy.research.utils;



public class TidalTrust
{

	/**
	 * TidalTrust algorithm to infer trust
	 * 
	 * @param userTNsMap
	 *            {user, {trustors}} map
	 * @param userTrustorsMap
	 * @param userRatingsMap
	 *            {user, {trust ratings}} map
	 * @param source
	 *            source user
	 * @param sink
	 *            target user
	 * @param maxDepth
	 *            maximum length of the searching path
	 * @return
	 */

	@SuppressWarnings({ "unchecked" })
	public static Map<String, Double> runAlgorithm(Map<String, Map<String, Double>> userTrusteesMap,

			Map<String, Map<String, Double>> userTrustorsMap, Map<String, List<TrustRating>> userRatingsMap,
