下面以Window版本为例说明GridSim的安装。
压缩包的文档结构图如下:
为了能计算机的任意位置能够使用到gridsim的类库我们设置一下classpath
.;E:/gridsimtoolkit/jars/gridsim.jar;E:/gridsimtoolkit/jars/simjava2.jar
(3)测试运行结果
(1)安装准备工作
在www.sun.com下载并安装J2SE,并配置好环境变量。
从网站http://sourceforge.net/projects/gridsim上可以下载gridsim的最新版本GridSim Toolkit 4.1,下来是一个zip的压缩包。
(2)Gridsim安装
解压这个压缩包到一个位置(如:c:/).压缩包的文档结构图如下:
$gridsimtoolkit-4.1/ -- the current GridSim directory (top level)
classes/ -- The GridSim class files
doc/ -- GridSim and SimJava API Documentation
eduni/
gridsim/
examples/ -- GridSim examples, see examples/README.txt for details
jars/ -- jar archives
source/ -- The GridSim Java source code
gridsim/*.java
gridsim/auction/*.java -- framework for the auction model
gridsim/datagrid/*.java -- framework for the Data Grids model
gridsim/filter/*.java -- filters incoming events
gridsim/index/*.java -- framework for the Grid Info Service model
gridsim/net/*.java -- framework for the network model
gridsim/resFailure/*.java -- framework for the resource failure model
gridsim/util/*.java -- includes some statistics classes.
classes/ -- The GridSim class files
doc/ -- GridSim and SimJava API Documentation
eduni/
gridsim/
examples/ -- GridSim examples, see examples/README.txt for details
jars/ -- jar archives
source/ -- The GridSim Java source code
gridsim/*.java
gridsim/auction/*.java -- framework for the auction model
gridsim/datagrid/*.java -- framework for the Data Grids model
gridsim/filter/*.java -- filters incoming events
gridsim/index/*.java -- framework for the Grid Info Service model
gridsim/net/*.java -- framework for the network model
gridsim/resFailure/*.java -- framework for the resource failure model
gridsim/util/*.java -- includes some statistics classes.
为了能计算机的任意位置能够使用到gridsim的类库我们设置一下classpath
.;E:/gridsimtoolkit/jars/gridsim.jar;E:/gridsimtoolkit/jars/simjava2.jar
(3)测试运行结果
测试文件是软件包中的$gridsimtoolkit-4.1/examples/Example01
该文件显示了如何使用API来讲三台机器初始化为一个网路资源
测试文件如下
/**//*
* Author: Anthony Sulistio
* Date: April 2003
* Description: A simple program to demonstrate of how to use GridSim package.
* This example shows how to create one Grid resource with three
* machines.
*
* NOTE: The values used from this example are taken from the GridSim paper.
* http://www.gridbus.org/gridsim/
* $Id: Example1.java,v 1.6 2004/05/29 05:24:00 anthony Exp $
*/
import java.util.*;
import gridsim.*;
/** *//**
* This class creates one Grid resource with three machines. Before creating
* any of GridSim entities, you should remember to call
* <tt>GridSim.Init()</tt>.
*/
class Example1
...{
/** *//**
* Main function to run this example
*/
public static void main(String[] args)
...{
System.out.println("Starting example of how to create one Grid
* Author: Anthony Sulistio
* Date: April 2003
* Description: A simple program to demonstrate of how to use GridSim package.
* This example shows how to create one Grid resource with three
* machines.
*
* NOTE: The values used from this example are taken from the GridSim paper.
* http://www.gridbus.org/gridsim/
* $Id: Example1.java,v 1.6 2004/05/29 05:24:00 anthony Exp $
*/
import java.util.*;
import gridsim.*;
/** *//**
* This class creates one Grid resource with three machines. Before creating
* any of GridSim entities, you should remember to call
* <tt>GridSim.Init()</tt>.
*/
class Example1
...{
/** *//**
* Main function to run this example
*/
public static void main(String[] args)
...{
System.out.println("Starting example of how to create one Grid