/*
 * Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
 *
 * This file is part of PeerfactSim.KOM.
 * 
 * PeerfactSim.KOM is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 * 
 * PeerfactSim.KOM is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with PeerfactSim.KOM.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction;

import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;

/**
 * @author  Julian Zobel
 * @version 1.0, Nov 2018
 */
public class TwoPointFixedAttractionGenerator extends AbstractAttractionProvider {
	
	private double x1, x2, y1, y2;
	
	@XMLConfigurableConstructor({ "x1", "y1", "x2", "y2"})
	public TwoPointFixedAttractionGenerator(double x1, double y1, double x2, double y2) {
		
		super();
		
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x2;
		this.y2 = y2;
		
		createAttractionPoints();
	}
		
	private void createAttractionPoints() {
				
		PositionVector p1 = new PositionVector(x1, y1);		
		AttractionPoint ap1 = new AttractionPoint("AP1", p1);
		ap1.setRadius(100);
		addAttractionPoint(ap1);
		
		
		PositionVector p2 = new PositionVector(x2, y2);		
		AttractionPoint ap2 = new AttractionPoint("AP2", p2);
		ap2.setRadius(100);
		addAttractionPoint(ap2);
	}

	
}
