我是 java 新手,吃过饭。我正在尝试创建网格单元(网格单元)类型为网格单元(值层单元)的列表,但我不断收到错误“GridCell 类型不是通用的;它不能用参数参数化”
我该如何解决?
package tester;
import java.util.List;
import repast.simphony.context.Context;
import repast.simphony.engine.environment.RunEnvironment;
import repast.simphony.engine.schedule.ScheduledMethod;
import repast.simphony.parameter.Parameters;
//import repast.simphony.query.space.grid.GridCell;
import repast.simphony.query.space.grid.GridCellNgh;
import repast.simphony.space.grid.Grid;
import repast.simphony.space.grid.GridPoint;
import repast.simphony.valueLayer.AbstractGridFunction;
import repast.simphony.valueLayer.BufferedGridValueLayer;
import repast.simphony.valueLayer.BufferedGridValueLayer.Buffer;
import repast.simphony.valueLayer.GridCell;
import repast.simphony.valueLayer.MaxGridFunction;
import repast.simphony.valueLayer.MinGridFunction;
private void Move() {
// TODO Auto-generated method stub
BufferedGridValueLayer heat = (BufferedGridValueLayer) context.getValueLayer("Heat Layer");
Grid <Object> grid = (Grid <Object>) context.getProjection("Insulation Grid");
//Get the Grid Location of this insulation unit.
GridPoint pt = grid.getLocation(this);
//Use the GridCellNgh to retrieve the list of of Gridcells (grid) contianing Gridcells (valueLayergrid).
GridCellNgh <GridCell> nghCreator = new GridCellNgh <GridCell> (grid, pt, GridCell.class, 1, 1);
List <GridCell <GridCell>> gridCells = nghCreator.getNeighborhood(true);
}