Commit ae871feb authored by jimonreal's avatar jimonreal
Browse files

Adding support for Person

parent d1c30abe
/*
* Copyright (c) 2005-2010 KOM – Multimedia Communications Lab
*
* This file is part of Simonstrator.KOM.
*
* Simonstrator.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.tudarmstadt.maki.simonstrator.api.component.vehicular;
import de.tudarmstadt.maki.simonstrator.api.component.HostComponent;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkRoute;
import java.util.List;
public interface PedestrianInformationComponent
extends HostComponent {
void setPedestrianID(String pedestrianID);
void setPedestrianSpeed(double pedestrianSpeed);
void setPedestrianGap(double pedestrianGap);
boolean isValid();
String getPedestrianType();
String getPedestrianID();
List<String> getNextTLS(String pedestrianId);
RoadNetworkEdge getCurrentRoad();
double getPedestrianWaitingTime();
double getPedestrianCurrentSpeed();
RoadNetworkRoute getCurrentRoute();
double getStep();
void resetPersonID();
}
package de.tudarmstadt.maki.simonstrator.api.component.vehicular.api;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetwork;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkRoute;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoExitAvailableException;
import java.util.List;
/**
*
* @author Tobias Meuser (tobias.meuser@kom.tu-darmstadt.de)
* @version 1.0 at 06.11.2017
*
*/
public interface PersonController {
/**
* This method is used to restrict the shown vehicles to the vehicles in a
* certain area.
*
* @param pStartX
* the x-start of the observed area
* @param pStartY
* the y-start of the observed area
* @param pEndX
* the x-end of the observed area
* @param pEndY
* the x-end of the observed area
*/
void setObservedArea(double pStartX, double pStartY, double pEndX, double pEndY);
/**
* Get the position of a vehicle
*
* @param pPersonID
* the person id of the person (provided by
* {@link #getAllPersons()})
* @return the position of the vehicle
*/
Location getPersonPosition(String pPersonID);
/**
* Get the position of a person at a certain timestep. The maximum
* available timestep can be requested with
* {@link #getMaximumAvailablePrediction()}
*
* @param pStep
* the timestep at which the position is requested
* @param pPersonID
* the person id of the person (provided by
* {@link #getAllPersons()})
* @return the position of the person
*/
Location getPersonPosition(double pStep, String pPersonID);
/**
* Perform the next step of the simulator.
*
* @return True if successful, false otherwise
*/
boolean nextStep();
/**
* Get the ids of all persons in the streets.
*
* @return a list of all persons ids
*/
List<String> getAllPersons();
/**
* Get the ids of all persons in the streets at a certain timestep.
*
* @param pStep
* the timestep at which the active persons are requested
* @return a list of all persons ids
*/
List<String> getAllPersons(double pStep);
/**
* Returns the current route of the person, only available for
* {@link de.tud.kom.p2psim.impl.topology.movement.vehicular.sumo.simulation.controller.traci.TraciSimulationController}
*
* @param pPersonID
* the person id of the person (provided by
* {@link #getAllPersons()})
* @return The current route of the person
*/
RoadNetworkRoute getCurrentRoute(String pPersonID);
/**
* Returns the maximum available prediction
*
* @return the maximum available prediction
*/
double getMaximumAvailablePrediction();
/**
* Change the route of a person
*
* @param pPersonID
* the person id of the person (provided by
* {@link #getAllPersons()})
* @param pRoute
* the new route of the person
*/
void reroutePerson(String pPersonID, RoadNetworkRoute pRoute);
/**
* Finds a new route of the vehicle towards the given destination
*
* @param pPerson
* the vehicle id of the vehicle (provided by
* {@link #getAllPersons()})
* @return a new route for the person
* @throws NoAdditionalRouteAvailableException
* if no additional route is found
*/
RoadNetworkRoute findNewRoute(String pPerson)
throws NoAdditionalRouteAvailableException;
/**
* Finds a new route of the person towards the given destination
*
* @param pPerson
* the vehicle id of the vehicle (provided by
* {@link #getAllPersons()})
* @param pEdgesToAvoid
* Edges that must not be included in the route
* @param pKeepDestination
* should the destination be kept or is route possible
* @return a new route for the person
* @throws NoAdditionalRouteAvailableException
* if no additional route is found
* @throws NoExitAvailableException
* if no exit is found
*/
RoadNetworkRoute findNewRoute(String pPerson,
List<RoadNetworkEdge> pEdgesToAvoid, boolean pKeepDestination)
throws NoAdditionalRouteAvailableException,
NoExitAvailableException;
/**
* get the current step of the simulator
*
* @return the step of the simulator
*/
double getStep();
/**
* get the start time of the simulator
*
* @return the start time of the simulator
*/
double getStart();
/**
* Initializes the controller
*/
void init();
/**
* get speed of a person pace
*
* @param pPersonID
* the person id of the person (provided by
* {@link #getAllPersons()})
* @return the current speed of the person
*/
double getPersonSpeed(String pPersonID);
/**
* Stops the person
*
* @param pPerson
* the person id of the person (provided by
* {@link #getAllPersons()})
*/
void stopPerson(String pPerson);
String getPersonType(String pPersonID);
void setPersonSpeed(String pPersonID, double pPersonSpeed);
void setPersonMaxSpeed(String pPersonID, double pPersonSpeed);
void setPersonGap(String pPersonID, double gap);
String getPersonRoadId(String pPersonID);
List<String> getNextTLS(String pPersonID);
double getPersonWaitingTime(String pPersonID);
RoadNetwork getRoadNetwork();
RoadNetworkEdge getCurrentEdge(String pPersonID);
RoadNetworkEdge getEdgeFromId(String controlledRoad);
void reroutePerson(String pPersonID);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment