⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 createmap.java

📁 本人历尽千辛万苦找的clustream中的jar包
💻 JAVA
字号:
package org.osu.ogsa.stream.info;import java.util.*;import java.io.*;import java.net.URL;import java.util.Random;import java.util.*;import java.lang.Math;public class CreateMap {        public static void main(String args[] ) 	{		Date forRand = new Date();		Random rand = new Random(forRand.getTime());		Random rand1 = new Random(forRand.getTime() + 10);		Random rand2 = new Random(forRand.getTime() + 20);		int i,j ;		String strInfo;		int edgeCount = 0 ;		String strI, strJ;		for(i = 1; i <=5 ; i ++)		{			for(j = 6; j <= 20; j ++)			{				edgeCount ++;				if(i < 10)					strI = "osumed0" + i;				else					strI = "osumed" + i;				if(j < 10)					strJ = "osumed0" + j;				else					strJ = "osumed" +j;				strInfo = "\"\" " + strI +" " + strJ+ " "+CreateMap.randnum(rand2, 1000) + "000";				System.out.println(strInfo);			}		}		int nTemp = -1;		for(i = 6; i < 20; i++)			for(j = i+1; j <= 20; j++)			{				if(CreateMap.Biased_Coin(rand, 0.7) == 1)				{					//create an edge					edgeCount ++;					edgeCount ++;					if(i < 10)						strI = "osumed0" + i;					else						strI = "osumed" + i;					if(j < 10)						strJ = "osumed0" + j;					else						strJ = "osumed" +j;					nTemp = CreateMap.randnum(rand1, 1000);					strInfo = "\"\" " + strI +" " + strJ+ " "+ nTemp + "000";					System.out.println(strInfo);					strInfo = "\"\" " + strJ +" " + strI+ " "+nTemp + "000";					System.out.println(strInfo);				}			}		System.out.println("edges " + edgeCount);	}        public static int Biased_Coin(Random rand, double probability)	{		return Biased_Coin(rand, probability, 100);	}	public static int Biased_Coin(Random rand, double probability, int factor)	{		int rand_int = 1 + (Math.abs(rand.nextInt()) % factor );		if(rand_int <= (int)(probability* (double)factor))			return 1;		else			return 0;	}	public static int randnum(Random rand, int factor)	{		int rand_int = 1 + (Math.abs(rand.nextInt()) % factor );		return rand_int;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -