本文作者:admin

每一期的双色球历史记录我用类来描述:java

摘要: 原理是根据双色球开奖的历史数据,根据各种易经八卦,天时等随机因素预测下一期的双色球号码。完整代码在我的上:.java是主程序:每一期的双色球历史记录我用类来描述:每一期的历史记录的每一位我也单独用另一个类来描述:er每一位的聚合类:执行.java,即可根据过去的历史记录推算出下一期的结果了。过去的历史记录越多,结果越准确。...

原理是根据双色球开奖的历史数据周易八卦预测双色球周易八卦预测双色球,根据各种易经八卦,天时等随机因素预测下一期的双色球号码。

完整代码在我的上:

.java是主程序:

package ball;
public class MainFrame
{
	public static void main(String[] args) 
	{
		Processor processor = new Processor();
		HistoryRecordEntry entry = new HistoryRecordEntry();
		
		// fill history data
		//2003001
		processor.insert(10, 11, 12, 13, 26, 28, 11);
		processor.insert( 4,  9, 19, 20, 21, 26, 12);
		processor.insert( 1,  7, 10, 23, 28, 32, 16);
		processor.insert( 4,  6,  7, 10, 13, 25,  3);
		processor.insert( 4,  6, 15, 17, 30, 31, 16);
		processor.insert( 1,  3, 10, 21, 26, 27,  6);
		processor.insert( 1,  9, 19, 21, 23, 26,  7);
		processor.insert( 5,  8,  9, 14, 17, 23,  8);
		processor.insert( 5,  9, 18, 20, 22, 30,  9);
		processor.insert( 1,  2,  8, 13, 17, 24, 13);
		processor.insert( 4,  5, 11, 12, 30, 32, 15);
		processor.insert( 2, 12, 16, 17, 27, 30, 12); // 2003012
		processor.insert( 8, 13, 17, 21, 23, 32, 12);
		processor.insert( 3,  5,  7,  8, 21, 31,  2);
		processor.insert( 4, 11, 19, 25, 26, 32, 13);
		processor.insert(11, 17, 28, 30, 31, 33,  6);
		processor.insert( 5,  8, 18, 23, 25, 31,  6); // 2003017
		System.out.println("Current Number: " + processor.getTotalRecordNumber());
		processor.start();
	}
}

每一期的双色球历史记录我用类来描述:

package ball;
public class HistoryRecordEntry 
{
	private int[] Number;
	
	public HistoryRecordEntry()
	{
		Number = new int[Configuration.MaxDigit];
	}
	public int getNumberFromDigit(int Digit)
	{
		return Number[Digit];
	}
	public void fillData(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7 )
	{
		Number[0] = arg1;
		Number[1] = arg2;
		Number[2] = arg3;
		Number[3] = arg4;
		Number[4] = arg5;
		Number[5] = arg6;
		Number[6] = arg7;
	}
}

每一期的历史记录的每一位我也单独用另一个类来描述:er

package ball;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.Vector;
import java.util.Map.Entry;
/* example: 13 occurs 15 time
 * 			2  occurs 12 time
 */
public class OccuranceForEachNumber
{
	private HashMap OccuranceEachDigit = null;
	
	private HashMap> CondensedOccurance = null;
	
	public OccuranceForEachNumber()
	{
		OccuranceEachDigit = new HashMap();
	}
	public boolean isNumberExist(int Number)
	{
		return OccuranceEachDigit.containsKey(Number);
	}
	public void updateNumberOccurance(int Number)
	{
		int CurrentOccurance = OccuranceEachDigit.get(Number);
		CurrentOccurance++;
		OccuranceEachDigit.put(Number,CurrentOccurance);
	}
	
	public void initialNumberOccurance(int Number)
	{
		OccuranceEachDigit.put(Number, 1);
	}
	
	public void ListOccuranceForEachNumber()
	{
		Set> set = OccuranceEachDigit.entrySet();
		Iterator> itor = set.iterator();
		while(itor.hasNext())
		{
		   Entry entry = itor.next();
		   int Digit = entry.getKey();
		   System.out.println("Number: " + Digit + " Occurance: " +  entry.getValue() );		   
		}
	}
	
	public void condense()
	{
		if (CondensedOccurance != null )
			CondensedOccurance.clear();
		CondensedOccurance = new HashMap>();
		Set> set = OccuranceEachDigit.entrySet();
		Iterator> itor = set.iterator();
		while(itor.hasNext())
		{
			Entry entry = itor.next();
			int NumberwithOccurance = entry.getKey();
			int Occurance = entry.getValue();
			if( CondensedOccurance.containsKey(entry.getValue()) == false)
			{
				Vector NumberListWithSameOccurance = new Vector();	
				NumberListWithSameOccurance.add(NumberwithOccurance);
				CondensedOccurance.put(Occurance, NumberListWithSameOccurance);
			}
			else
			{
				Vector existingNumberList = CondensedOccurance.get(Occurance);
				existingNumberList.add(NumberwithOccurance);
				CondensedOccurance.put(Occurance, existingNumberList);
			}
		}
		Set>> Revertset = CondensedOccurance.entrySet();
		Iterator>> Revertitor = Revertset.iterator();
		while(Revertitor.hasNext())
		{
			Entry> entry = Revertitor.next();
			System.out.println("Occruance: " + entry.getKey());
			for( int i = 0 ; i < entry.getValue().size(); i ++)
			{
				System.out.println("Number with same Occurance: " + entry.getValue().elementAt(i));
			}
		}
	}
}

每一位的聚合类:

package ball;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.Map.Entry;
public class OccuranceOverview
{
	private HashMap OccuranceOverview = null;
	public OccuranceOverview()
	{
		OccuranceOverview = new HashMap();
		for ( int i = 0 ; i < Configuration.MaxDigit; i++ )
		{
			OccuranceForEachNumber Occurance4EachNumber = new OccuranceForEachNumber();
			OccuranceOverview.put(i,Occurance4EachNumber);
		}
	}
	
	public OccuranceForEachNumber getOccuranceInstanceByDigit(int Digit)
	{
		return OccuranceOverview.get(Digit);
	}
	
	public void updateDigitOccurance(int Digit,OccuranceForEachNumber OccuranceInstance)
	{
		OccuranceOverview.put(Digit, OccuranceInstance);
	}
	public void listOccuranceForEachDigit()
	{
		Set> set = OccuranceOverview.entrySet();
		Iterator> itor = set.iterator();
		while(itor.hasNext())
		{
		   Entry entry = itor.next();
		   int Digit = entry.getKey();
		   System.out.println("**************** Digit: " + Digit + " Information Begin! *************");
		   entry.getValue().ListOccuranceForEachNumber();
		   System.out.println("**************** Condensed Information! **********");
		   entry.getValue().condense();
		}
	}
}

执行.java,即可根据过去的历史记录推算出下一期的结果了。过去的历史记录越多,结果越准确。