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

📄 asptest.java

📁 collective processing environment for mobile devices. It is an environment for mobile device to solv
💻 JAVA
字号:

import com.ibm.dthreads.DThread;
import com.ibm.dthreads.DistributedExecutionManager;
import com.ibm.dthreads.SPMDDistributedExecutionManager;
import com.ibm.dthreads.DThreadExecutionContext;

public class ASPTest {

public static void main(String args[]) 
{
	   long start,end;
	   start=System.currentTimeMillis();
	if(args.length<3)
	{
		System.out.println("Command Usage : ");
		System.out.println("java ASPTest prog_name no_of_threads no_of_vertices");
		System.out.println("Please Refer README.htm");
		System.exit(0); 
	}
	int totalthreads=Integer.parseInt(args[1]);
	int noofvertices=Integer.parseInt(args[2]);
	   boolean debugMode=true;

        //For Global array version of ASP
	   Object arraydthread=null;
	   if(args[0].equals("global"))
	   {
	   arraydthread = new FloydGlobal(noofvertices);
	   }


	   //For Broadcast version of ASP
	   if(args[0].equals("bcast"))
	   {
	   arraydthread = new FloydBroadcast(noofvertices);
	   }


	   //For DRunnable version of ASP
	   if(args[0].equals("runnable"))
		{ 
		ASPRunnable dthreadObject = new ASPRunnable(noofvertices);
		arraydthread=new DThread(dthreadObject);
		}
	   DistributedExecutionManager dmanager = new SPMDDistributedExecutionManager(0);
	   DThreadExecutionContext context = new DThreadExecutionContext(totalthreads);
     
         //set the mode of execution..If the user want to have it in debug mode then all the debug messages will be there in log files       
         context.setMode(args);
 	   context.setexperimentName("Floyd");
	   dmanager.execute((DThread)arraydthread,context);
	   end=System.currentTimeMillis();
	   System.out.println("TIME TAKEN IS "+(end-start)+" milliSeconds");
}
}


⌨️ 快捷键说明

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