summaryrefslogtreecommitdiffstats
path: root/VRP/src/Algoritmo
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2022-05-31 11:49:37 -0500
committerMitsuo Tokumori <[email protected]>2022-05-31 11:49:37 -0500
commitfa1b0cbb95e0579991686bb0da1237704e70f02e (patch)
tree76eca5c61b1654282eb317fd0e5ecf5aea179566 /VRP/src/Algoritmo
parent8de97e6433aedec8390c9f080b1b40fffbf036bc (diff)
parenta9b520b0d51db85cec0c11c11d22ee70414e5034 (diff)
downloadDP1_project-fa1b0cbb95e0579991686bb0da1237704e70f02e.tar.gz
DP1_project-fa1b0cbb95e0579991686bb0da1237704e70f02e.tar.bz2
DP1_project-fa1b0cbb95e0579991686bb0da1237704e70f02e.zip
Merge branch 'dayana' into mitsuo (and also gabs)
Primero hice merge con gabs, luego dayana
Diffstat (limited to 'VRP/src/Algoritmo')
-rw-r--r--VRP/src/Algoritmo/Almacen.java24
-rw-r--r--VRP/src/Algoritmo/Ciudad.java18
-rw-r--r--VRP/src/Algoritmo/Main.java15
-rw-r--r--VRP/src/Algoritmo/PlanTransporte.java14
-rw-r--r--VRP/src/Algoritmo/TipoAlmacen.java15
-rw-r--r--VRP/src/Algoritmo/Tramo.java24
-rw-r--r--VRP/src/Algoritmo/VRP.java57
-rw-r--r--VRP/src/Algoritmo/Vehiculo.java18
8 files changed, 185 insertions, 0 deletions
diff --git a/VRP/src/Algoritmo/Almacen.java b/VRP/src/Algoritmo/Almacen.java
new file mode 100644
index 0000000..52f3f13
--- /dev/null
+++ b/VRP/src/Algoritmo/Almacen.java
@@ -0,0 +1,24 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+public class Almacen {
+ Ciudad ciudad;
+ String region;
+ TipoAlmacen tipo;
+
+ public Almacen(Ciudad ciudad, String region, TipoAlmacen tipo) {
+ this.ciudad = ciudad;
+ this.region = region;
+ this.tipo = tipo;
+ }
+
+
+}
diff --git a/VRP/src/Algoritmo/Ciudad.java b/VRP/src/Algoritmo/Ciudad.java
new file mode 100644
index 0000000..81ef2c6
--- /dev/null
+++ b/VRP/src/Algoritmo/Ciudad.java
@@ -0,0 +1,18 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+public class Ciudad {
+ String nombre;
+ String region;
+ double longitud;
+ double latitud;
+
+}
diff --git a/VRP/src/Algoritmo/Main.java b/VRP/src/Algoritmo/Main.java
new file mode 100644
index 0000000..8b8aa93
--- /dev/null
+++ b/VRP/src/Algoritmo/Main.java
@@ -0,0 +1,15 @@
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+public class Main {
+
+ public static void main (String[] args){
+ int num_iter=45;
+ VRP vrp = new VRP();
+ vrp.init_data();
+ vrp.genetic_algorithm(num_iter);
+ }
+}
diff --git a/VRP/src/Algoritmo/PlanTransporte.java b/VRP/src/Algoritmo/PlanTransporte.java
new file mode 100644
index 0000000..cf5d66b
--- /dev/null
+++ b/VRP/src/Algoritmo/PlanTransporte.java
@@ -0,0 +1,14 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+public class PlanTransporte {
+
+}
diff --git a/VRP/src/Algoritmo/TipoAlmacen.java b/VRP/src/Algoritmo/TipoAlmacen.java
new file mode 100644
index 0000000..2f107ed
--- /dev/null
+++ b/VRP/src/Algoritmo/TipoAlmacen.java
@@ -0,0 +1,15 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+public class TipoAlmacen {
+ String nombre;
+ double capacidad;
+}
diff --git a/VRP/src/Algoritmo/Tramo.java b/VRP/src/Algoritmo/Tramo.java
new file mode 100644
index 0000000..eb2955d
--- /dev/null
+++ b/VRP/src/Algoritmo/Tramo.java
@@ -0,0 +1,24 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+public class Tramo {
+ Ciudad ciudad1;
+ Ciudad ciudad2;
+ double distancia;
+
+ public Tramo(Ciudad ciudad1, Ciudad ciudad2, double distancia) {
+ this.ciudad1 = ciudad1;
+ this.ciudad2 = ciudad2;
+ this.distancia = distancia;
+ }
+
+
+}
diff --git a/VRP/src/Algoritmo/VRP.java b/VRP/src/Algoritmo/VRP.java
new file mode 100644
index 0000000..a512e40
--- /dev/null
+++ b/VRP/src/Algoritmo/VRP.java
@@ -0,0 +1,57 @@
+
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+
+
+public class VRP {
+
+
+ public static void genetic_algorithm(int max_iter){
+ //generar poblacion inicial aleatoria
+ PlanTransporte poblacion[] = new PlanTransporte[200];
+ PlanTransporte nueva_generacion[] = new PlanTransporte[200];
+
+ poblacion = init_population();
+
+ //evaluar fitness de la poblacion
+ evaluar(poblacion);
+
+ for(int i=1;i<max_iter;i++){
+ nueva_generacion = generar_nueva_generacion(poblacion);
+ //aplicar operadores geneticos a la nueva generacion
+ poblacion = survive(poblacion, nueva_generacion);
+ }
+
+ }
+
+ private static PlanTransporte[] generar_nueva_generacion(PlanTransporte[] poblacion) {
+ return null;
+ }
+
+ private static PlanTransporte[] survive(PlanTransporte[] poblacion, PlanTransporte[] nueva_generacion) {
+ return null;
+ }
+
+ public static PlanTransporte[] init_population(){
+
+
+ for(int i=1;i<10;i++){
+
+ }
+
+ return null;
+ }
+
+ public static void evaluar(PlanTransporte[] poblacion){
+
+
+ }
+
+ public static void init_data() {
+
+ }
+}
diff --git a/VRP/src/Algoritmo/Vehiculo.java b/VRP/src/Algoritmo/Vehiculo.java
new file mode 100644
index 0000000..94efadd
--- /dev/null
+++ b/VRP/src/Algoritmo/Vehiculo.java
@@ -0,0 +1,18 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Algoritmo;
+
+/**
+ *
+ * @author DAYANA
+ */
+public class Vehiculo {
+ String placa;
+ Ciudad ciudad_origen;
+ int capacidad;
+ double velocidad;
+
+}