~gdanix/ingress-attack-genetic-optimizer

80b1bb7e160050fc376d848b69b2b0753d407dc0 — Daniel Trujillo Viedma 4 years ago 6125752 master
Add Maven support
23 files changed, 49 insertions(+), 6 deletions(-)

M dist/IngressAttackOptimizer-0.3.jar
R res/data.yaml => docs/data.yaml
M pom.xml
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/Application.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/Application.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/Test.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/Test.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticIngressAttackOptimizer.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticIngressAttackOptimizer.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticObservableAlgorithm.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticObservableAlgorithm.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/crossover/SMOTEXMPCrossover.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/crossover/SMOTEXMPCrossover.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/individual/XMPChromosome.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/individual/XMPChromosome.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/mutation/JumpXMPMutation.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/mutation/JumpXMPMutation.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/PopulationObserver.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/PopulationObserver.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/XMPPopulation.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/XMPPopulation.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/model/Portal.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Portal.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/model/Resonator.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Resonator.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/model/Scene.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Scene.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/model/XMP.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/XMP.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/util/Configuration.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/util/Configuration.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/util/Util.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/util/Util.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/view/MainWindow.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/MainWindow.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/view/Paintable.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/Paintable.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/view/Visualizer.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/Visualizer.java}
R src/{org/gdanix/genetic_examples/ingress_attack_optimizer/view/XMPPopulationPresenter.java => main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/XMPPopulationPresenter.java}
R res/portalTexture.png => src/main/resources/img/portalTexture.png
M dist/IngressAttackOptimizer-0.3.jar => dist/IngressAttackOptimizer-0.3.jar +0 -0
R res/data.yaml => docs/data.yaml +0 -0
M pom.xml => pom.xml +22 -1
@@ 4,7 4,7 @@
  <artifactId>IngressAttackOptimizer</artifactId>
  <version>0.3</version>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <sourceDirectory>src/main/java</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>


@@ 14,6 14,27 @@
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <executions>
        <execution>
          <phase>package</phase>
          <goals>
            <goal>single</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <archive>
          <manifest>
            <mainClass>org.gdanix.genetic_examples.ingress_attack_optimizer.Application</mainClass>
          </manifest>
        </archive>
        <descriptorRefs>
          <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>
      </configuration>
    </plugin>
    </plugins>
  </build>
  <dependencies>

R src/org/gdanix/genetic_examples/ingress_attack_optimizer/Application.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/Application.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/Test.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/Test.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticIngressAttackOptimizer.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticIngressAttackOptimizer.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticObservableAlgorithm.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/GeneticObservableAlgorithm.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/crossover/SMOTEXMPCrossover.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/crossover/SMOTEXMPCrossover.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/individual/XMPChromosome.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/individual/XMPChromosome.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/mutation/JumpXMPMutation.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/mutation/JumpXMPMutation.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/PopulationObserver.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/PopulationObserver.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/XMPPopulation.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/genetic/population/XMPPopulation.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Portal.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Portal.java +21 -4
@@ 19,7 19,7 @@ public class Portal implements Paintable{
	private int axaShields;
	private List<Portal> links;
	
	private final double x, y;
	private final int x, y;
	
	private final int sprite_width, sprite_height;
	


@@ 35,7 35,7 @@ public class Portal implements Paintable{
	}

	
	public Portal(double x, double y, int commonShields, int rareShields, int veryRareShields, int axaShields) {
	public Portal(int x, int y, int commonShields, int rareShields, int veryRareShields, int axaShields) {
		super();
		this.commonShields = commonShields;
		this.rareShields = rareShields;


@@ 87,8 87,8 @@ public class Portal implements Paintable{
		
		try {
			// Draw portal sprite
			g.drawImage(ImageIO.read(new File("res/portalTexture.png")), rx-sprite_width/2, ry-sprite_height/2, sprite_width, sprite_height, null);	
			
			g.drawImage(ImageIO.read(this.getClass().getResourceAsStream("/img/portalTexture.png")), rx-sprite_width/2, ry-sprite_height/2, sprite_width, sprite_height, null);	
						
			// Draw shields
			int alpha = Math.min((int)Math.round(this.shieldMitigation()*2.55), 255);
			g.setColor(new Color(255, 142, 247, alpha));


@@ 105,4 105,21 @@ public class Portal implements Paintable{
			e.printStackTrace();
		}
	}


	public boolean hasLink(Portal portal) {
		return links.contains(portal);
	}


	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Portal){
			Portal portal = (Portal) obj;
			
			if(portal.x == this.x && portal.y == this.y) return true;
			else return false;
			
		} else return false;
	}
}

R src/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Resonator.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Resonator.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Scene.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/Scene.java +6 -1
@@ 72,7 72,12 @@ public class Scene {
				Iterator linkIndexes = ((List) portalData.get("links")).iterator();
			
				while(linkIndexes.hasNext()){
					scene.portals.get(i).addLink(scene.portals.get((int)linkIndexes.next()));
					int linkIndex = (int)linkIndexes.next();
					
					if(! scene.portals.get(i).hasLink(scene.portals.get(linkIndex))) {
						scene.portals.get(i).addLink(scene.portals.get(linkIndex));
						scene.portals.get(linkIndex).addLink(scene.portals.get(i));
					}
				}
			}
			

R src/org/gdanix/genetic_examples/ingress_attack_optimizer/model/XMP.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/model/XMP.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/util/Configuration.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/util/Configuration.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/util/Util.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/util/Util.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/view/MainWindow.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/MainWindow.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/view/Paintable.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/Paintable.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/view/Visualizer.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/Visualizer.java +0 -0
R src/org/gdanix/genetic_examples/ingress_attack_optimizer/view/XMPPopulationPresenter.java => src/main/java/org/gdanix/genetic_examples/ingress_attack_optimizer/view/XMPPopulationPresenter.java +0 -0
R res/portalTexture.png => src/main/resources/img/portalTexture.png +0 -0