diff --git a/src/main/java/de/hs_mannheim/domain/System.java b/src/main/java/de/hs_mannheim/domain/System.java index 02847ab..28a32be 100644 --- a/src/main/java/de/hs_mannheim/domain/System.java +++ b/src/main/java/de/hs_mannheim/domain/System.java @@ -93,7 +93,23 @@ public class System { } public ArrayList random_destinations_bike(){ - return new ArrayList(); + ArrayList result = new ArrayList<>(); + + InputStream inputStream = Main.class.getResourceAsStream("/zip.csv"); + + try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { + String line; + while ((line = reader.readLine()) != null) { + + line = line.replace("\"", ""); + + if(Double.parseDouble(distance(line.split(";")[0]).replace(" km", "")) < 100) + result.add(line); + + } + } catch (Exception e) {} + + return result; } public String[] destination_details(String destination_zip){