diff options
Diffstat (limited to 'VRP/src')
| -rw-r--r-- | VRP/src/Algoritmo/Almacen.java | 24 | ||||
| -rw-r--r-- | VRP/src/Algoritmo/Ciudad.java | 18 | ||||
| -rw-r--r-- | VRP/src/Algoritmo/Main.java | 15 | ||||
| -rw-r--r-- | VRP/src/Algoritmo/PlanTransporte.java | 14 | ||||
| -rw-r--r-- | VRP/src/Algoritmo/TipoAlmacen.java | 15 | ||||
| -rw-r--r-- | VRP/src/Algoritmo/Tramo.java | 24 | ||||
| -rw-r--r-- | VRP/src/Algoritmo/VRP.java | 57 | ||||
| -rw-r--r-- | VRP/src/Algoritmo/Vehiculo.java | 18 | 
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; +     +} | 
