Blame view

src/preypredator/PPRuntimeGPU.java 1.16 KB
1b1e928cc   glaville   initial import of...
1
  package preypredator;
1b1e928cc   glaville   initial import of...
2
3
4
5
6
7
8
9
10
11
12
13
  import mcmas.api.MCMASContext;
  import mcmas.core.MCMCommandQueueProperty;
  import mcmas.plugins.axb.AXBPlugin;
  import mcmas.plugins.gridsearch.GridSearchPlugin;
  
  
  public class PPRuntimeGPU implements PPRuntime {
  	
  	private final MCMASContext context;
  	private final AXBPlugin axbPlugin;
  	private final GridSearchPlugin searchPlugin;
  	
d2e21dea1   glaville   Update preys-pred...
14
15
  	public PPRuntimeGPU() {
  		this.context = new MCMASContext(MCMCommandQueueProperty.ENABLE_PROFILING);
1b1e928cc   glaville   initial import of...
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  		this.axbPlugin = new AXBPlugin(context);
  		this.searchPlugin = new GridSearchPlugin(context);
  	}
  	
  	@Override
  	public void growGrass(PPGrid grass, float factor, int growth, int min, int max) {
  		axbPlugin.clampedTransform(grass.getStorage(), factor, growth, min, max);
  	}
  	
  	@Override
  	public void selectMaxTarget(PPGrid grid, int radius, int[] xPositions,
  			int[] yPositions, int[] newXPositions,
  			int[] newYPositions) {
  		searchPlugin.findMaxCell(grid, radius, xPositions, yPositions, newXPositions, newYPositions);
  	}
  	
  	@Override
  	public void selectNearestNonZeroTarget(PPGrid grid, int radius,
  			int[] xPositions, int[] yPositions, int[] newXPositions,
  			int[] newYPositions) {
  		// TODO Auto-generated method stub
  	}
  
  }