summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--VRP/build.xml73
-rw-r--r--VRP/manifest.mf3
-rw-r--r--VRP/nbproject/build-impl.xml1771
-rw-r--r--VRP/nbproject/genfiles.properties8
-rw-r--r--VRP/nbproject/project.properties95
-rw-r--r--VRP/nbproject/project.xml15
-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
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AlmacenController.java55
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java55
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java53
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java54
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AlmacenDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AveriaDao.java12
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/CamionDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/ClienteDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java11
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PedidoDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RegionDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RutaDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoAveriaDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoCamionDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoDao.java13
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java11
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/UsuarioDao.java14
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AlmacenDaoImp.java87
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AveriaDaoImp.java87
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/CamionDaoImp.java87
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/ClienteDaoImp.java86
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PTGDaoImp.java86
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PedidoDaoImp.java85
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RegionDaoImp.java85
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RutaDaoImp.java85
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoAveriaDaoImp.java85
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoCamionDaoImp.java85
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoDaoImp.java85
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoRutaDaoImp.java86
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/UsuarioDaoImp.java85
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AlmacenService.java33
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java32
-rw-r--r--back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java32
-rw-r--r--test/LAB_5_ACC_2021_1.ipynb700
67 files changed, 5249 insertions, 0 deletions
diff --git a/VRP/build.xml b/VRP/build.xml
new file mode 100644
index 0000000..33b72e9
--- /dev/null
+++ b/VRP/build.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="VRP" default="default" basedir=".">
+ <description>Builds, tests, and runs the project VRP.</description>
+ <import file="nbproject/build-impl.xml"/>
+ <!--
+
+ There exist several targets which are by default empty and which can be
+ used for execution of your tasks. These targets are usually executed
+ before and after some main targets. They are:
+
+ -pre-init: called before initialization of project properties
+ -post-init: called after initialization of project properties
+ -pre-compile: called before javac compilation
+ -post-compile: called after javac compilation
+ -pre-compile-single: called before javac compilation of single file
+ -post-compile-single: called after javac compilation of single file
+ -pre-compile-test: called before javac compilation of JUnit tests
+ -post-compile-test: called after javac compilation of JUnit tests
+ -pre-compile-test-single: called before javac compilation of single JUnit test
+ -post-compile-test-single: called after javac compilation of single JUunit test
+ -pre-jar: called before JAR building
+ -post-jar: called after JAR building
+ -post-clean: called after cleaning build products
+
+ (Targets beginning with '-' are not intended to be called on their own.)
+
+ Example of inserting an obfuscator after compilation could look like this:
+
+ <target name="-post-compile">
+ <obfuscate>
+ <fileset dir="${build.classes.dir}"/>
+ </obfuscate>
+ </target>
+
+ For list of available properties check the imported
+ nbproject/build-impl.xml file.
+
+
+ Another way to customize the build is by overriding existing main targets.
+ The targets of interest are:
+
+ -init-macrodef-javac: defines macro for javac compilation
+ -init-macrodef-junit: defines macro for junit execution
+ -init-macrodef-debug: defines macro for class debugging
+ -init-macrodef-java: defines macro for class execution
+ -do-jar: JAR building
+ run: execution of project
+ -javadoc-build: Javadoc generation
+ test-report: JUnit report generation
+
+ An example of overriding the target for project execution could look like this:
+
+ <target name="run" depends="VRP-impl.jar">
+ <exec dir="bin" executable="launcher.exe">
+ <arg file="${dist.jar}"/>
+ </exec>
+ </target>
+
+ Notice that the overridden target depends on the jar target and not only on
+ the compile target as the regular run target does. Again, for a list of available
+ properties which you can use, check the target you are overriding in the
+ nbproject/build-impl.xml file.
+
+ -->
+</project>
diff --git a/VRP/manifest.mf b/VRP/manifest.mf
new file mode 100644
index 0000000..328e8e5
--- /dev/null
+++ b/VRP/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/VRP/nbproject/build-impl.xml b/VRP/nbproject/build-impl.xml
new file mode 100644
index 0000000..4367b20
--- /dev/null
+++ b/VRP/nbproject/build-impl.xml
@@ -0,0 +1,1771 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT ***
+*** EDIT ../build.xml INSTEAD ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+ - initialization
+ - compilation
+ - jar
+ - execution
+ - debugging
+ - javadoc
+ - test compilation
+ - test execution
+ - test debugging
+ - applet
+ - cleanup
+
+ -->
+<project xmlns:if="ant:if" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" xmlns:unless="ant:unless" basedir=".." default="default" name="VRP-impl">
+ <fail message="Please build using Ant 1.8.0 or higher.">
+ <condition>
+ <not>
+ <antversion atleast="1.8.0"/>
+ </not>
+ </condition>
+ </fail>
+ <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+ <!--
+ ======================
+ INITIALIZATION SECTION
+ ======================
+ -->
+ <target name="-pre-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init" name="-init-private">
+ <property file="nbproject/private/config.properties"/>
+ <property file="nbproject/private/configs/${config}.properties"/>
+ <property file="nbproject/private/private.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private" name="-init-user">
+ <property file="${user.properties.file}"/>
+ <!-- The two properties below are usually overridden -->
+ <!-- by the active platform. Just a fallback. -->
+ <property name="default.javac.source" value="1.6"/>
+ <property name="default.javac.target" value="1.6"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+ <property file="nbproject/configs/${config}.properties"/>
+ <property file="nbproject/project.properties"/>
+ </target>
+ <target name="-init-modules-supported">
+ <condition property="modules.supported.internal" value="true">
+ <not>
+ <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
+ </not>
+ </condition>
+ </target>
+ <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
+ <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute name="property"/>
+ <attribute name="sourcepath"/>
+ <sequential>
+ <loadresource property="@{property}" quiet="true">
+ <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
+ <filterchain>
+ <stripjavacomments/>
+ <linecontainsregexp>
+ <regexp pattern="module .* \{"/>
+ </linecontainsregexp>
+ <tokenfilter>
+ <linetokenizer/>
+ <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
+ </tokenfilter>
+ <striplinebreaks/>
+ </filterchain>
+ </loadresource>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
+ <fail message="Java 9 support requires Ant 1.10.0 or higher.">
+ <condition>
+ <not>
+ <antversion atleast="1.10.0"/>
+ </not>
+ </condition>
+ </fail>
+ <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
+ <condition property="named.module.internal">
+ <and>
+ <isset property="module.name"/>
+ <length length="0" string="${module.name}" when="greater"/>
+ </and>
+ </condition>
+ <condition property="unnamed.module.internal">
+ <not>
+ <isset property="named.module.internal"/>
+ </not>
+ </condition>
+ <property name="javac.modulepath" value=""/>
+ <property name="run.modulepath" value="${javac.modulepath}"/>
+ <property name="module.build.classes.dir" value="${build.classes.dir}"/>
+ <property name="debug.modulepath" value="${run.modulepath}"/>
+ <property name="javac.upgrademodulepath" value=""/>
+ <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
+ <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
+ <and>
+ <isset property="javac.systemmodulepath"/>
+ <length length="0" string="${javac.systemmodulepath}" when="greater"/>
+ </and>
+ </condition>
+ <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
+ <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
+ <property name="module.name" value=""/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
+ <property name="platform.java" value="${java.home}/bin/java"/>
+ <available file="${manifest.file}" property="manifest.available"/>
+ <condition property="splashscreen.available">
+ <and>
+ <not>
+ <equals arg1="${application.splash}" arg2="" trim="true"/>
+ </not>
+ <available file="${application.splash}"/>
+ </and>
+ </condition>
+ <condition property="main.class.available">
+ <and>
+ <isset property="main.class"/>
+ <not>
+ <equals arg1="${main.class}" arg2="" trim="true"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="profile.available">
+ <and>
+ <isset property="javac.profile"/>
+ <length length="0" string="${javac.profile}" when="greater"/>
+ <not>
+ <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
+ </not>
+ </and>
+ </condition>
+ <condition property="do.archive">
+ <or>
+ <not>
+ <istrue value="${jar.archive.disabled}"/>
+ </not>
+ <istrue value="${not.archive.disabled}"/>
+ </or>
+ </condition>
+ <condition property="do.archive+manifest.available">
+ <and>
+ <isset property="manifest.available"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="do.archive+main.class.available">
+ <and>
+ <isset property="main.class.available"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="do.archive+splashscreen.available">
+ <and>
+ <isset property="splashscreen.available"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="do.archive+profile.available">
+ <and>
+ <isset property="profile.available"/>
+ <istrue value="${do.archive}"/>
+ </and>
+ </condition>
+ <condition property="have.tests">
+ <or>
+ <available file="${test.src.dir}"/>
+ </or>
+ </condition>
+ <condition property="have.sources">
+ <or>
+ <available file="${src.dir}"/>
+ </or>
+ </condition>
+ <condition property="netbeans.home+have.tests">
+ <and>
+ <isset property="netbeans.home"/>
+ <isset property="have.tests"/>
+ </and>
+ </condition>
+ <condition property="no.javadoc.preview">
+ <and>
+ <isset property="javadoc.preview"/>
+ <isfalse value="${javadoc.preview}"/>
+ </and>
+ </condition>
+ <property name="run.jvmargs" value=""/>
+ <property name="run.jvmargs.ide" value=""/>
+ <property name="javac.compilerargs" value=""/>
+ <property name="work.dir" value="${basedir}"/>
+ <condition property="no.deps">
+ <and>
+ <istrue value="${no.dependencies}"/>
+ </and>
+ </condition>
+ <property name="javac.debug" value="true"/>
+ <property name="javadoc.preview" value="true"/>
+ <property name="application.args" value=""/>
+ <property name="source.encoding" value="${file.encoding}"/>
+ <property name="runtime.encoding" value="${source.encoding}"/>
+ <property name="manifest.encoding" value="${source.encoding}"/>
+ <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+ <and>
+ <isset property="javadoc.encoding"/>
+ <not>
+ <equals arg1="${javadoc.encoding}" arg2=""/>
+ </not>
+ </and>
+ </condition>
+ <property name="javadoc.encoding.used" value="${source.encoding}"/>
+ <property name="includes" value="**"/>
+ <property name="excludes" value=""/>
+ <property name="do.depend" value="false"/>
+ <condition property="do.depend.true">
+ <istrue value="${do.depend}"/>
+ </condition>
+ <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+ <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+ <and>
+ <isset property="endorsed.classpath"/>
+ <not>
+ <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
+ </not>
+ </and>
+ </condition>
+ <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
+ <isset property="profile.available"/>
+ </condition>
+ <condition else="false" property="jdkBug6558476">
+ <and>
+ <matches pattern="1\.[56]" string="${java.specification.version}"/>
+ <not>
+ <os family="unix"/>
+ </not>
+ </and>
+ </condition>
+ <condition else="false" property="javac.fork">
+ <or>
+ <istrue value="${jdkBug6558476}"/>
+ <istrue value="${javac.external.vm}"/>
+ </or>
+ </condition>
+ <property name="jar.index" value="false"/>
+ <property name="jar.index.metainf" value="${jar.index}"/>
+ <property name="copylibs.rebase" value="true"/>
+ <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+ <condition property="junit.available">
+ <or>
+ <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
+ <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
+ </or>
+ </condition>
+ <condition property="testng.available">
+ <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
+ </condition>
+ <condition property="junit+testng.available">
+ <and>
+ <istrue value="${junit.available}"/>
+ <istrue value="${testng.available}"/>
+ </and>
+ </condition>
+ <condition else="testng" property="testng.mode" value="mixed">
+ <istrue value="${junit+testng.available}"/>
+ </condition>
+ <condition else="" property="testng.debug.mode" value="-mixed">
+ <istrue value="${junit+testng.available}"/>
+ </condition>
+ <property name="java.failonerror" value="true"/>
+ </target>
+ <target name="-post-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+ <fail unless="src.dir">Must set src.dir</fail>
+ <fail unless="test.src.dir">Must set test.src.dir</fail>
+ <fail unless="build.dir">Must set build.dir</fail>
+ <fail unless="dist.dir">Must set dist.dir</fail>
+ <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+ <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+ <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+ <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+ <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+ <fail unless="dist.jar">Must set dist.jar</fail>
+ </target>
+ <target name="-init-macrodef-property">
+ <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${@{value}}"/>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <attribute default="${javac.modulepath}" name="modulepath"/>
+ <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
+ <attribute default="${javac.processorpath}" name="processorpath"/>
+ <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
+ <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="${javac.debug}" name="debug"/>
+ <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
+ <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
+ <attribute default="${empty.dir}" name="gensrcdir"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <condition property="warn.excludes.internal">
+ <and>
+ <isset property="named.module.internal"/>
+ <length length="0" string="@{excludes}" trim="true" when="greater"/>
+ </and>
+ </condition>
+ <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
+ <property location="${build.dir}/empty" name="empty.dir"/>
+ <mkdir dir="${empty.dir}"/>
+ <mkdir dir="@{apgeneratedsrcdir}"/>
+ <condition property="processormodulepath.set">
+ <resourcecount count="0" when="greater">
+ <path>
+ <pathelement path="@{processormodulepath}"/>
+ </path>
+ </resourcecount>
+ </condition>
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+ <src>
+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </src>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <modulepath>
+ <path path="@{modulepath}"/>
+ </modulepath>
+ <upgrademodulepath>
+ <path path="@{upgrademodulepath}"/>
+ </upgrademodulepath>
+ <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
+ <compilerarg line="${javac.profile.cmd.line.arg}"/>
+ <compilerarg line="${javac.compilerargs}"/>
+ <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
+ <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
+ <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
+ <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
+ <compilerarg line="${ap.processors.internal}"/>
+ <compilerarg line="${annotation.processing.processor.options}"/>
+ <compilerarg value="-s"/>
+ <compilerarg path="@{apgeneratedsrcdir}"/>
+ <compilerarg line="${ap.proc.none.internal}"/>
+ <customize/>
+ </javac>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <attribute default="${javac.modulepath}" name="modulepath"/>
+ <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
+ <attribute default="${javac.processorpath}" name="processorpath"/>
+ <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="${javac.debug}" name="debug"/>
+ <attribute default="${empty.dir}" name="sourcepath"/>
+ <attribute default="${empty.dir}" name="gensrcdir"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.dir}/empty" name="empty.dir"/>
+ <mkdir dir="${empty.dir}"/>
+ <mkdir dir="@{apgeneratedsrcdir}"/>
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+ <src>
+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </src>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <compilerarg line="${javac.profile.cmd.line.arg}"/>
+ <compilerarg line="${javac.compilerargs}"/>
+ <compilerarg value="-processorpath"/>
+ <compilerarg path="@{processorpath}:${empty.dir}"/>
+ <compilerarg line="${ap.processors.internal}"/>
+ <compilerarg line="${annotation.processing.processor.options}"/>
+ <compilerarg value="-s"/>
+ <compilerarg path="@{apgeneratedsrcdir}"/>
+ <compilerarg line="${ap.proc.none.internal}"/>
+ <customize/>
+ </javac>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+ <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <attribute default="${javac.modulepath}" name="modulepath"/>
+ <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
+ <attribute default="${javac.processorpath}" name="processorpath"/>
+ <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="${javac.debug}" name="debug"/>
+ <attribute default="${empty.dir}" name="sourcepath"/>
+ <attribute default="${empty.dir}" name="gensrcdir"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.dir}/empty" name="empty.dir"/>
+ <mkdir dir="${empty.dir}"/>
+ <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+ <src>
+ <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </src>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <compilerarg line="${javac.profile.cmd.line.arg}"/>
+ <compilerarg line="${javac.compilerargs}"/>
+ <customize/>
+ </javac>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+ <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${src.dir}" name="srcdir"/>
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <attribute default="${javac.classpath}" name="classpath"/>
+ <sequential>
+ <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ </depend>
+ </sequential>
+ </macrodef>
+ <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${build.classes.dir}" name="destdir"/>
+ <sequential>
+ <fail unless="javac.includes">Must set javac.includes</fail>
+ <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+ <path>
+ <filelist dir="@{destdir}" files="${javac.includes}"/>
+ </path>
+ <globmapper from="*.java" to="*.class"/>
+ </pathconvert>
+ <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+ <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+ <delete>
+ <files includesfile="${javac.includesfile.binary}"/>
+ </delete>
+ <delete>
+ <fileset file="${javac.includesfile.binary}"/>
+ </delete>
+ </sequential>
+ </macrodef>
+ </target>
+ <target if="${junit.available}" name="-init-macrodef-junit-init">
+ <condition else="false" property="nb.junit.batch" value="true">
+ <and>
+ <istrue value="${junit.available}"/>
+ <not>
+ <isset property="test.method"/>
+ </not>
+ </and>
+ </condition>
+ <condition else="false" property="nb.junit.single" value="true">
+ <and>
+ <istrue value="${junit.available}"/>
+ <isset property="test.method"/>
+ </and>
+ </condition>
+ </target>
+ <target name="-init-test-properties">
+ <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
+ <property name="test.binarytestincludes" value=""/>
+ <property name="test.binaryexcludes" value=""/>
+ </target>
+ <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
+ <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <element name="customizePrototype" optional="true"/>
+ <sequential>
+ <property name="junit.forkmode" value="perTest"/>
+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ <modulepath>
+ <path path="${run.test.modulepath}"/>
+ </modulepath>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg value="-ea"/>
+ <jvmarg line="${run.test.jvmargs}"/>
+ <customizePrototype/>
+ </junit>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
+ <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <element name="customizePrototype" optional="true"/>
+ <sequential>
+ <property name="junit.forkmode" value="perTest"/>
+ <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ <formatter type="brief" usefile="false"/>
+ <formatter type="xml"/>
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg value="-ea"/>
+ <customizePrototype/>
+ </junit>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
+ <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <j2seproject3:junit-prototype>
+ <customizePrototype>
+ <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+ <customize/>
+ </customizePrototype>
+ </j2seproject3:junit-prototype>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
+ <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <j2seproject3:junit-prototype>
+ <customizePrototype>
+ <batchtest todir="${build.test.results.dir}">
+ <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+ <filename name="@{testincludes}"/>
+ </fileset>
+ <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+ <filename name="${test.binarytestincludes}"/>
+ </fileset>
+ </batchtest>
+ <customize/>
+ </customizePrototype>
+ </j2seproject3:junit-prototype>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
+ <target if="${testng.available}" name="-init-macrodef-testng">
+ <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
+ <isset property="test.method"/>
+ </condition>
+ <union id="test.set">
+ <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
+ <filename name="@{testincludes}"/>
+ </fileset>
+ </union>
+ <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
+ <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="VRP" testname="TestNG tests" workingDir="${work.dir}">
+ <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
+ <propertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </propertyset>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <customize/>
+ </testng>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-macrodef-test-impl">
+ <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <element implicit="true" name="customize" optional="true"/>
+ <sequential>
+ <echo>No tests executed.</echo>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
+ <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <element implicit="true" name="customize" optional="true"/>
+ <sequential>
+ <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+ <customize/>
+ </j2seproject3:junit>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
+ <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <element implicit="true" name="customize" optional="true"/>
+ <sequential>
+ <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+ <customize/>
+ </j2seproject3:testng>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
+ <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <sequential>
+ <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+ <customize>
+ <jvmarg line="${run.jvmargs}"/>
+ <jvmarg line="${run.jvmargs.ide}"/>
+ </customize>
+ </j2seproject3:test-impl>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
+ <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <element name="customizeDebuggee" optional="true"/>
+ <sequential>
+ <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+ <customize>
+ <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
+ <customizeDebuggee/>
+ </customize>
+ </j2seproject3:junit>
+ </sequential>
+ </macrodef>
+ </target>
+ <target if="${testng.available}" name="-init-macrodef-testng-debug">
+ <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${main.class}" name="testClass"/>
+ <attribute default="" name="testMethod"/>
+ <element name="customize2" optional="true"/>
+ <sequential>
+ <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
+ <isset property="test.method"/>
+ </condition>
+ <condition else="-suitename VRP -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+ <matches pattern=".*\.xml" string="@{testClass}"/>
+ </condition>
+ <delete dir="${build.test.results.dir}" quiet="true"/>
+ <mkdir dir="${build.test.results.dir}"/>
+ <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
+ <customizeDebuggee>
+ <customize2/>
+ <jvmarg value="-ea"/>
+ <arg line="${testng.debug.mode}"/>
+ <arg line="-d ${build.test.results.dir}"/>
+ <arg line="-listener org.testng.reporters.VerboseReporter"/>
+ <arg line="${testng.cmd.args}"/>
+ </customizeDebuggee>
+ </j2seproject3:debug>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
+ <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${main.class}" name="testClass"/>
+ <attribute default="" name="testMethod"/>
+ <element implicit="true" name="customize2" optional="true"/>
+ <sequential>
+ <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
+ <customize2/>
+ </j2seproject3:testng-debug>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
+ <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <attribute default="${main.class}" name="testClass"/>
+ <attribute default="" name="testMethod"/>
+ <sequential>
+ <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+ <customizeDebuggee>
+ <jvmarg line="${run.jvmargs}"/>
+ <jvmarg line="${run.jvmargs.ide}"/>
+ </customizeDebuggee>
+ </j2seproject3:test-debug-impl>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
+ <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${includes}" name="includes"/>
+ <attribute default="${excludes}" name="excludes"/>
+ <attribute default="**" name="testincludes"/>
+ <attribute default="" name="testmethods"/>
+ <attribute default="${main.class}" name="testClass"/>
+ <attribute default="" name="testMethod"/>
+ <sequential>
+ <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
+ <customize2>
+ <syspropertyset>
+ <propertyref prefix="test-sys-prop."/>
+ <mapper from="test-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ </customize2>
+ </j2seproject3:testng-debug-impl>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
+ <!--
+ pre NB7.2 profiling section; consider it deprecated
+ -->
+ <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
+ <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
+ <macrodef name="resolve">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${env.@{value}}"/>
+ </sequential>
+ </macrodef>
+ <macrodef name="profile">
+ <attribute default="${main.class}" name="classname"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property environment="env"/>
+ <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+ <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg value="${profiler.info.jvmargs.agent}"/>
+ <jvmarg line="${profiler.info.jvmargs}"/>
+ <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+ <arg line="${application.args}"/>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
+ <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+ <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+ </target>
+ <!--
+ end of pre NB7.2 profiling section
+ -->
+ <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+ <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${main.class}" name="name"/>
+ <attribute default="${debug.modulepath}" name="modulepath"/>
+ <attribute default="${debug.classpath}" name="classpath"/>
+ <attribute default="" name="stopclassname"/>
+ <sequential>
+ <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+ <modulepath>
+ <path path="@{modulepath}"/>
+ </modulepath>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ </nbjpdastart>
+ </sequential>
+ </macrodef>
+ <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${build.classes.dir}" name="dir"/>
+ <sequential>
+ <nbjpdareload>
+ <fileset dir="@{dir}" includes="${fix.classes}">
+ <include name="${fix.includes}*.class"/>
+ </fileset>
+ </nbjpdareload>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-debug-args">
+ <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+ <os family="windows"/>
+ </condition>
+ <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+ <isset property="debug.transport"/>
+ </condition>
+ </target>
+ <target depends="-init-debug-args" name="-init-macrodef-debug">
+ <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${module.name}" name="modulename"/>
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${debug.modulepath}" name="modulepath"/>
+ <attribute default="${debug.classpath}" name="classpath"/>
+ <element name="customizeDebuggee" optional="true"/>
+ <sequential>
+ <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
+ <customize>
+ <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
+ <customizeDebuggee/>
+ </customize>
+ </j2seproject1:java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
+ <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="${module.name}" name="modulename"/>
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${run.modulepath}" name="modulepath"/>
+ <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
+ <attribute default="${run.classpath}" name="classpath"/>
+ <attribute default="jvm" name="jvm"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <modulepath>
+ <pathelement path="@{modulepath}"/>
+ <pathelement location="${module.build.classes.dir}"/>
+ </modulepath>
+ <upgrademodulepath>
+ <path path="@{upgrademodulepath}"/>
+ </upgrademodulepath>
+ <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+ <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <jvmarg line="${run.jvmargs.ide}"/>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
+ <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="" name="modulename"/>
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="${run.modulepath}" name="modulepath"/>
+ <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
+ <attribute default="${run.classpath}" name="classpath"/>
+ <attribute default="jvm" name="jvm"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <modulepath>
+ <path path="@{modulepath}"/>
+ </modulepath>
+ <upgrademodulepath>
+ <path path="@{upgrademodulepath}"/>
+ </upgrademodulepath>
+ <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+ <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <jvmarg line="${run.jvmargs.ide}"/>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
+ <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <attribute default="" name="modulename"/>
+ <attribute default="${main.class}" name="classname"/>
+ <attribute default="" name="modulepath"/>
+ <attribute default="${run.classpath}" name="classpath"/>
+ <attribute default="jvm" name="jvm"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
+ <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+ <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+ <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <jvmarg line="${run.jvmargs.ide}"/>
+ <classpath>
+ <path path="@{classpath}"/>
+ </classpath>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <customize/>
+ </java>
+ </sequential>
+ </macrodef>
+ </target>
+ <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
+ <target name="-init-macrodef-copylibs">
+ <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+ <attribute default="${manifest.file}" name="manifest"/>
+ <element name="customize" optional="true"/>
+ <sequential>
+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+ <pathconvert property="run.classpath.without.build.classes.dir">
+ <path path="${run.classpath}"/>
+ <map from="${build.classes.dir.resolved}" to=""/>
+ </pathconvert>
+ <pathconvert pathsep=" " property="jar.classpath">
+ <path path="${run.classpath.without.build.classes.dir}"/>
+ <chainedmapper>
+ <flattenmapper/>
+ <filtermapper>
+ <replacestring from=" " to="%20"/>
+ </filtermapper>
+ <globmapper from="*" to="lib/*"/>
+ </chainedmapper>
+ </pathconvert>
+ <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+ <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+ <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
+ <manifest>
+ <attribute name="Class-Path" value="${jar.classpath}"/>
+ <customize/>
+ </manifest>
+ </copylibs>
+ </sequential>
+ </macrodef>
+ </target>
+ <target name="-init-presetdef-jar">
+ <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+ <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
+ <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
+ </jar>
+ </presetdef>
+ </target>
+ <target name="-init-ap-cmdline-properties">
+ <property name="annotation.processing.enabled" value="true"/>
+ <property name="annotation.processing.processors.list" value=""/>
+ <property name="annotation.processing.processor.options" value=""/>
+ <property name="annotation.processing.run.all.processors" value="true"/>
+ <property name="javac.processorpath" value="${javac.classpath}"/>
+ <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+ <condition property="ap.supported.internal" value="true">
+ <not>
+ <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+ </not>
+ </condition>
+ </target>
+ <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+ <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+ <isfalse value="${annotation.processing.run.all.processors}"/>
+ </condition>
+ <condition else="" property="ap.proc.none.internal" value="-proc:none">
+ <isfalse value="${annotation.processing.enabled}"/>
+ </condition>
+ </target>
+ <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+ <property name="ap.cmd.line.internal" value=""/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+ <!--
+ ===================
+ COMPILATION SECTION
+ ===================
+ -->
+ <target name="-deps-jar-init" unless="built-jar.properties">
+ <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+ <delete file="${built-jar.properties}" quiet="true"/>
+ </target>
+ <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+ <echo level="warn" message="Cycle detected: VRP was already built"/>
+ </target>
+ <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+ <mkdir dir="${build.dir}"/>
+ <touch file="${built-jar.properties}" verbose="false"/>
+ <property file="${built-jar.properties}" prefix="already.built.jar."/>
+ <antcall target="-warn-already-built-jar"/>
+ <propertyfile file="${built-jar.properties}">
+ <entry key="${basedir}" value=""/>
+ </propertyfile>
+ </target>
+ <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+ <target depends="init" name="-check-automatic-build">
+ <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+ </target>
+ <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+ <antcall target="clean">
+ <param name="no.dependencies" value="true"/>
+ </antcall>
+ </target>
+ <target depends="init,deps-jar" name="-pre-pre-compile">
+ <mkdir dir="${build.classes.dir}"/>
+ </target>
+ <target name="-pre-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target if="do.depend.true" name="-compile-depend">
+ <pathconvert property="build.generated.subdirs">
+ <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="*"/>
+ </dirset>
+ </pathconvert>
+ <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+ <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+ <copy todir="${build.classes.dir}">
+ <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target if="has.persistence.xml" name="-copy-persistence-xml">
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <copy todir="${build.classes.dir}/META-INF">
+ <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
+ </copy>
+ </target>
+ <target name="-post-compile">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+ <target name="-pre-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <j2seproject3:force-recompile/>
+ <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
+ </target>
+ <target name="-post-compile-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+ <!--
+ ====================
+ JAR BUILDING SECTION
+ ====================
+ -->
+ <target depends="init" name="-pre-pre-jar">
+ <dirname file="${dist.jar}" property="dist.jar.dir"/>
+ <mkdir dir="${dist.jar.dir}"/>
+ </target>
+ <target name="-pre-jar">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile" name="-check-module-main-class">
+ <pathconvert property="main.class.file">
+ <string value="${main.class}"/>
+ <unpackagemapper from="*" to="*.class"/>
+ </pathconvert>
+ <condition property="do.module.main.class">
+ <and>
+ <isset property="main.class.available"/>
+ <available file="${build.classes.dir}/module-info.class"/>
+ <available file="${build.classes.dir}/${main.class.file}"/>
+ <isset property="libs.CopyLibs.classpath"/>
+ <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
+ </and>
+ </condition>
+ </target>
+ <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
+ <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
+ <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
+ </target>
+ <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
+ <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+ <touch file="${tmp.manifest.file}" verbose="false"/>
+ </target>
+ <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
+ <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+ <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
+ </target>
+ <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
+ <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
+ <attribute name="Main-Class" value="${main.class}"/>
+ </manifest>
+ </target>
+ <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
+ <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
+ <attribute name="Profile" value="${javac.profile}"/>
+ </manifest>
+ </target>
+ <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
+ <basename file="${application.splash}" property="splashscreen.basename"/>
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+ <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
+ <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+ </manifest>
+ </target>
+ <target depends="init,compile" name="-check-do-mkdist">
+ <condition property="do.mkdist">
+ <and>
+ <isset property="do.archive"/>
+ <isset property="libs.CopyLibs.classpath"/>
+ <not>
+ <istrue value="${mkdist.disabled}"/>
+ </not>
+ <not>
+ <available file="${build.classes.dir}/module-info.class"/>
+ </not>
+ </and>
+ </condition>
+ </target>
+ <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
+ <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+ <echo level="info">To run this application from the command line without Ant, try:</echo>
+ <property location="${dist.jar}" name="dist.jar.resolved"/>
+ <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
+ <j2seproject1:jar manifest="${tmp.manifest.file}"/>
+ <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+ <property location="${dist.jar}" name="dist.jar.resolved"/>
+ <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
+ <isset property="named.module.internal"/>
+ </condition>
+ <pathconvert property="run.classpath.with.dist.jar">
+ <path path="${run.classpath}"/>
+ <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
+ </pathconvert>
+ <pathconvert property="run.modulepath.with.dist.jar">
+ <path location="${dist.jar.resolved}"/>
+ <path path="${run.modulepath}"/>
+ <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+ </pathconvert>
+ <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
+ <isset property="named.module.internal"/>
+ </condition>
+ <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
+ <and>
+ <isset property="modules.supported.internal"/>
+ <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
+ </and>
+ </condition>
+ <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
+ <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
+ </condition>
+ <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
+ <isset property="do.module.main.class"/>
+ </condition>
+ <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
+ <isset property="named.module.internal"/>
+ </condition>
+ <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}">
+ <isset property="main.class.available"/>
+ </condition>
+ <condition else="debug" property="jar.usage.level" value="info">
+ <isset property="main.class.available"/>
+ </condition>
+ <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
+ </target>
+ <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
+ <delete>
+ <fileset file="${tmp.manifest.file}"/>
+ </delete>
+ </target>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
+ <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
+ <target name="-post-jar">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
+ <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
+ <!--
+ =================
+ DEPLOY SECTION
+ =================
+ -->
+ <target name="-pre-deploy">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init" name="-check-jlink">
+ <condition property="do.jlink.internal">
+ <and>
+ <istrue value="${do.jlink}"/>
+ <isset property="do.archive"/>
+ <isset property="named.module.internal"/>
+ </and>
+ </condition>
+ </target>
+ <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
+ <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
+ <property name="jlink.launcher.name" value="${application.title}"/>
+ <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
+ <and>
+ <isset property="jlink.additionalmodules"/>
+ <length length="0" string="${jlink.additionalmodules}" when="greater"/>
+ </and>
+ </condition>
+ <condition property="jlink.do.strip.internal">
+ <and>
+ <isset property="jlink.strip"/>
+ <istrue value="${jlink.strip}"/>
+ </and>
+ </condition>
+ <condition property="jlink.do.additionalparam.internal">
+ <and>
+ <isset property="jlink.additionalparam"/>
+ <length length="0" string="${jlink.additionalparam}" when="greater"/>
+ </and>
+ </condition>
+ <condition property="jlink.do.launcher.internal">
+ <and>
+ <istrue value="${jlink.launcher}"/>
+ <isset property="main.class.available"/>
+ </and>
+ </condition>
+ <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
+ <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
+ <exec executable="${platform.jlink}">
+ <arg value="--module-path"/>
+ <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
+ <arg value="--add-modules"/>
+ <arg value="${jlink.add.modules}"/>
+ <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
+ <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
+ <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
+ <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
+ <arg value="--output"/>
+ <arg value="${dist.jlink.output}"/>
+ </exec>
+ </target>
+ <target name="-post-deploy">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
+ <!--
+ =================
+ EXECUTION SECTION
+ =================
+ -->
+ <target depends="init,compile" description="Run a main class." name="run">
+ <j2seproject1:java>
+ <customize>
+ <arg line="${application.args}"/>
+ </customize>
+ </j2seproject1:java>
+ </target>
+ <target name="-do-not-recompile">
+ <property name="javac.includes.binary" value=""/>
+ </target>
+ <target depends="init,compile-single" name="run-single">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <j2seproject1:java classname="${run.class}"/>
+ </target>
+ <target depends="init,compile-test-single" name="run-test-with-main">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+ </target>
+ <!--
+ =================
+ DEBUGGING SECTION
+ =================
+ -->
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+ <j2seproject1:nbjpdastart name="${debug.class}"/>
+ </target>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+ </target>
+ <target depends="init,compile" name="-debug-start-debuggee">
+ <j2seproject3:debug>
+ <customizeDebuggee>
+ <arg line="${application.args}"/>
+ </customizeDebuggee>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+ <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+ </target>
+ <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <j2seproject3:debug classname="${debug.class}"/>
+ </target>
+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+ <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+ <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+ <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+ </target>
+ <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+ <target depends="init" name="-pre-debug-fix">
+ <fail unless="fix.includes">Must set fix.includes</fail>
+ <property name="javac.includes" value="${fix.includes}.java"/>
+ </target>
+ <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+ <j2seproject1:nbjpdareload/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+ <!--
+ =================
+ PROFILING SECTION
+ =================
+ -->
+ <!--
+ pre NB7.2 profiler integration
+ -->
+ <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <profile/>
+ </target>
+ <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
+ <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <profile classname="${profile.class}"/>
+ </target>
+ <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <profile classname="sun.applet.AppletViewer">
+ <customize>
+ <arg value="${applet.url}"/>
+ </customize>
+ </profile>
+ </target>
+ <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
+ <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+ <nbprofiledirect>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ </nbprofiledirect>
+ <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
+ <customize>
+ <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
+ <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+ <jvmarg value="${profiler.info.jvmargs.agent}"/>
+ <jvmarg line="${profiler.info.jvmargs}"/>
+ <classpath>
+ <path path="${run.test.classpath}"/>
+ </classpath>
+ </customize>
+ </j2seproject3:junit>
+ </target>
+ <!--
+ end of pre NB72 profiling section
+ -->
+ <target if="netbeans.home" name="-profile-check">
+ <condition property="profiler.configured">
+ <or>
+ <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
+ <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
+ </or>
+ </condition>
+ </target>
+ <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
+ <startprofiler/>
+ <antcall target="run"/>
+ </target>
+ <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <startprofiler/>
+ <antcall target="run-single"/>
+ </target>
+ <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
+ <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
+ <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+ <startprofiler/>
+ <antcall target="test-single"/>
+ </target>
+ <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
+ <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+ <startprofiler/>
+ <antcall target="run-test-with-main"/>
+ </target>
+ <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+ <startprofiler/>
+ <antcall target="run-applet"/>
+ </target>
+ <!--
+ ===============
+ JAVADOC SECTION
+ ===============
+ -->
+ <target depends="init" if="have.sources" name="-javadoc-build">
+ <mkdir dir="${dist.javadoc.dir}"/>
+ <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+ <and>
+ <isset property="endorsed.classpath.cmd.line.arg"/>
+ <not>
+ <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+ </not>
+ </and>
+ </condition>
+ <condition else="" property="bug5101868workaround" value="*.java">
+ <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
+ </condition>
+ <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
+ <and>
+ <isset property="javadoc.html5"/>
+ <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
+ </and>
+ </condition>
+ <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+ <classpath>
+ <path path="${javac.classpath}"/>
+ </classpath>
+ <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+ <filename name="**/*.java"/>
+ </fileset>
+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="**/*.java"/>
+ <exclude name="*.java"/>
+ </fileset>
+ <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
+ <arg line="${javadoc.html5.cmd.line.arg}"/>
+ </javadoc>
+ <copy todir="${dist.javadoc.dir}">
+ <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+ <filename name="**/doc-files/**"/>
+ </fileset>
+ <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+ <include name="**/doc-files/**"/>
+ </fileset>
+ </copy>
+ </target>
+ <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+ <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+ </target>
+ <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+ <!--
+ =========================
+ TEST COMPILATION SECTION
+ =========================
+ -->
+ <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+ <mkdir dir="${build.test.classes.dir}"/>
+ </target>
+ <target name="-pre-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
+ <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
+ <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
+ <and>
+ <isset property="test.module.name"/>
+ <length length="0" string="${test.module.name}" when="greater"/>
+ </and>
+ </condition>
+ <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED">
+ <and>
+ <isset property="test.module.name"/>
+ <length length="0" string="${test.module.name}" when="greater"/>
+ </and>
+ </condition>
+ </target>
+ <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
+ <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
+ <and>
+ <isset property="test.module.name"/>
+ <length length="0" string="${test.module.name}" when="greater"/>
+ </and>
+ </condition>
+ <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
+ <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
+ <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
+ <chainedmapper>
+ <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
+ <filtermapper>
+ <uniqfilter/>
+ <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
+ </filtermapper>
+ <cutdirsmapper dirs="1"/>
+ <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
+ </chainedmapper>
+ </pathconvert>
+ <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}">
+ <and>
+ <isset property="test.module.name"/>
+ <length length="0" string="${test.module.name}" when="greater"/>
+ </and>
+ </condition>
+ </target>
+ <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
+ <property name="javac.test.sourcepath" value="${empty.dir}"/>
+ <property name="javac.test.compilerargs" value=""/>
+ <property name="run.test.jvmargs" value=""/>
+ </target>
+ <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/>
+ <target if="do.depend.true" name="-compile-test-depend">
+ <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+ </target>
+ <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+ <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${javac.test.sourcepath}" srcdir="${test.src.dir}">
+ <customize>
+ <compilerarg line="${javac.test.compilerargs}"/>
+ </customize>
+ </j2seproject3:javac>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+ <target name="-pre-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+ <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+ <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+ <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}, module-info.java" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}">
+ <customize>
+ <compilerarg line="${javac.test.compilerargs}"/>
+ </customize>
+ </j2seproject3:javac>
+ <copy todir="${build.test.classes.dir}">
+ <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+ </copy>
+ </target>
+ <target name="-post-compile-test-single">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+ <!--
+ =======================
+ TEST EXECUTION SECTION
+ =======================
+ -->
+ <target depends="init" if="have.tests" name="-pre-test-run">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
+ <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
+ </target>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init" if="have.tests" name="test-report"/>
+ <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+ <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+ <target depends="init" if="have.tests" name="-pre-test-run-single">
+ <mkdir dir="${build.test.results.dir}"/>
+ </target>
+ <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+ <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+ <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
+ <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
+ <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+ <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
+ <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+ </target>
+ <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
+ <!--
+ =======================
+ TEST DEBUGGING SECTION
+ =======================
+ -->
+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
+ <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+ <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
+ </target>
+ <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
+ <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+ <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+ <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
+ </target>
+ <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+ <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+ </target>
+ <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+ <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
+ <target depends="debug-test-method" name="debug-single-method"/>
+ <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+ <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+ </target>
+ <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+ <!--
+ =========================
+ APPLET EXECUTION SECTION
+ =========================
+ -->
+ <target depends="init,compile-single" name="run-applet">
+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+ <j2seproject1:java classname="sun.applet.AppletViewer">
+ <customize>
+ <arg value="${applet.url}"/>
+ </customize>
+ </j2seproject1:java>
+ </target>
+ <!--
+ =========================
+ APPLET DEBUGGING SECTION
+ =========================
+ -->
+ <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+ <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+ <j2seproject3:debug classname="sun.applet.AppletViewer">
+ <customizeDebuggee>
+ <arg value="${applet.url}"/>
+ </customizeDebuggee>
+ </j2seproject3:debug>
+ </target>
+ <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+ <!--
+ ===============
+ CLEANUP SECTION
+ ===============
+ -->
+ <target name="-deps-clean-init" unless="built-clean.properties">
+ <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+ <delete file="${built-clean.properties}" quiet="true"/>
+ </target>
+ <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+ <echo level="warn" message="Cycle detected: VRP was already built"/>
+ </target>
+ <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+ <mkdir dir="${build.dir}"/>
+ <touch file="${built-clean.properties}" verbose="false"/>
+ <property file="${built-clean.properties}" prefix="already.built.clean."/>
+ <antcall target="-warn-already-built-clean"/>
+ <propertyfile file="${built-clean.properties}">
+ <entry key="${basedir}" value=""/>
+ </propertyfile>
+ </target>
+ <target depends="init" name="-do-clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.jlink.output}"/>
+ <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+ </target>
+ <target name="-post-clean">
+ <!-- Empty placeholder for easier customization. -->
+ <!-- You can override this target in the ../build.xml file. -->
+ </target>
+ <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+ <target name="-check-call-dep">
+ <property file="${call.built.properties}" prefix="already.built."/>
+ <condition property="should.call.dep">
+ <and>
+ <not>
+ <isset property="already.built.${call.subproject}"/>
+ </not>
+ <available file="${call.script}"/>
+ </and>
+ </condition>
+ </target>
+ <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+ <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+ <propertyset>
+ <propertyref prefix="transfer."/>
+ <mapper from="transfer.*" to="*" type="glob"/>
+ </propertyset>
+ </ant>
+ </target>
+</project>
diff --git a/VRP/nbproject/genfiles.properties b/VRP/nbproject/genfiles.properties
new file mode 100644
index 0000000..1ff5f4f
--- /dev/null
+++ b/VRP/nbproject/genfiles.properties
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=e2f7ff6d
+build.xml.script.CRC32=04b6befe
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=e2f7ff6d
+nbproject/build-impl.xml.script.CRC32=0fe6cb3b
diff --git a/VRP/nbproject/project.properties b/VRP/nbproject/project.properties
new file mode 100644
index 0000000..6689d76
--- /dev/null
+++ b/VRP/nbproject/project.properties
@@ -0,0 +1,95 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processor.options=
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.modulepath=\
+ ${run.modulepath}
+debug.test.classpath=\
+ ${run.test.classpath}
+debug.test.modulepath=\
+ ${run.test.modulepath}
+# Files in build.classes.dir which should be excluded from distribution jar
+dist.archive.excludes=
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/VRP.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+dist.jlink.dir=${dist.dir}/jlink
+dist.jlink.output=${dist.jlink.dir}/VRP
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.external.vm=true
+javac.modulepath=
+javac.processormodulepath=
+javac.processorpath=\
+ ${javac.classpath}
+javac.source=1.8
+javac.target=1.8
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+javac.test.modulepath=\
+ ${javac.modulepath}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.html5=false
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+# The jlink additional root modules to resolve
+jlink.additionalmodules=
+# The jlink additional command line parameters
+jlink.additionalparam=
+jlink.launcher=true
+jlink.launcher.name=VRP
+main.class=
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.modulepath=\
+ ${javac.modulepath}
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+run.test.modulepath=\
+ ${javac.test.modulepath}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/VRP/nbproject/project.xml b/VRP/nbproject/project.xml
new file mode 100644
index 0000000..f980bc3
--- /dev/null
+++ b/VRP/nbproject/project.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.java.j2seproject</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+ <name>VRP</name>
+ <source-roots>
+ <root id="src.dir"/>
+ </source-roots>
+ <test-roots>
+ <root id="test.src.dir"/>
+ </test-roots>
+ </data>
+ </configuration>
+</project>
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;
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AlmacenController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AlmacenController.java
new file mode 100644
index 0000000..e8d32a0
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AlmacenController.java
@@ -0,0 +1,55 @@
+package pe.edu.pucp.odiparback.controllers;
+
+import pe.edu.pucp.odiparback.models.Almacen;
+import pe.edu.pucp.odiparback.services.AlmacenService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/almacen")
+@CrossOrigin
+public class AlmacenController {
+ @Autowired
+ AlmacenService almacenService;
+
+ @GetMapping(value = "/")
+ List<Almacen> getAll(){
+ return almacenService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "almacen",key = "#id")
+ Almacen get(@PathVariable int id)throws AuthenticationException{
+ return almacenService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Almacen almacen)throws SQLException{
+ almacenService.register(almacen);
+ }
+
+ @PutMapping(value = "/")
+ Almacen update(@RequestBody Almacen almacen)throws SQLException{
+ return almacenService.update(almacen);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "almacen", allEntries = true)
+ void delete(@PathVariable int id){
+ almacenService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java
new file mode 100644
index 0000000..f5555d6
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/AveriaController.java
@@ -0,0 +1,55 @@
+package pe.edu.pucp.odiparback.controllers;
+
+import pe.edu.pucp.odiparback.models.Averia;
+import pe.edu.pucp.odiparback.services.AveriaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/averia")
+@CrossOrigin
+public class AveriaController {
+ @Autowired
+ AveriaService averiaService;
+
+ @GetMapping(value = "/")
+ List<Averia> getAll(){
+ return averiaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "averia",key = "#id")
+ Averia get(@PathVariable int id)throws AuthenticationException{
+ return averiaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Averia averia)throws SQLException{
+ averiaService.register(averia);
+ }
+
+ @PutMapping(value = "/")
+ Averia update(@RequestBody Averia averia)throws SQLException{
+ return averiaService.update(averia);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "averia", allEntries = true)
+ void delete(@PathVariable int id){
+ averiaService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java
new file mode 100644
index 0000000..59336b5
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/CamionController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Camion;
+import pe.edu.pucp.odiparback.services.CamionService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/camion")
+@CrossOrigin
+public class CamionController {
+ @Autowired
+ CamionService camionService;
+
+ @GetMapping(value = "/")
+ List<Camion> getAll(){
+ return camionService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "camion",key = "#id")
+ Camion get(@PathVariable int id)throws AuthenticationException{
+ return camionService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Camion camion)throws SQLException{
+ camionService.register(camion);
+ }
+
+ @PutMapping(value = "/")
+ Camion update(@RequestBody Camion camion)throws SQLException{
+ return camionService.update(camion);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "camion", allEntries = true)
+ void delete(@PathVariable int id){
+ camionService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java
new file mode 100644
index 0000000..c3e0b6d
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/ClienteController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Cliente;
+import pe.edu.pucp.odiparback.services.ClienteService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/cliente")
+@CrossOrigin
+public class ClienteController {
+ @Autowired
+ ClienteService clienteService;
+
+ @GetMapping(value = "/")
+ List<Cliente> getAll(){
+ return clienteService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "cliente",key = "#id")
+ Cliente get(@PathVariable int id)throws AuthenticationException{
+ return clienteService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Cliente cliente)throws SQLException{
+ clienteService.register(cliente);
+ }
+
+ @PutMapping(value = "/")
+ Cliente update(@RequestBody Cliente cliente)throws SQLException{
+ return clienteService.update(cliente);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "cliente", allEntries = true)
+ void delete(@PathVariable int id){
+ clienteService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java
new file mode 100644
index 0000000..adba375
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PTGController.java
@@ -0,0 +1,53 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.PTG;
+import pe.edu.pucp.odiparback.services.PTGService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/ptg")
+@CrossOrigin
+public class PTGController {
+ @Autowired
+ PTGService ptgService;
+
+ @GetMapping(value = "/")
+ List<PTG> getAll(){
+ return ptgService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "ptg",key = "#id")
+ PTG get(@PathVariable int id)throws AuthenticationException{
+ return ptgService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody PTG ptg)throws SQLException{
+ ptgService.register(ptg);
+ }
+
+ @PutMapping(value = "/")
+ PTG update(@RequestBody PTG ptg)throws SQLException{
+ return ptgService.update(ptg);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "ptg", allEntries = true)
+ void delete(@PathVariable int id){
+ ptgService.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java
new file mode 100644
index 0000000..a1a6c2e
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/PedidoController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Pedido;
+import pe.edu.pucp.odiparback.services.PedidoService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/pedido")
+@CrossOrigin
+public class PedidoController {
+ @Autowired
+ PedidoService pedidoService;
+
+ @GetMapping(value = "/")
+ List<Pedido> getAll(){
+ return pedidoService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "pedido",key = "#id")
+ Pedido get(@PathVariable int id)throws AuthenticationException{
+ return pedidoService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Pedido pedido)throws SQLException{
+ pedidoService.register(pedido);
+ }
+
+ @PutMapping(value = "/")
+ Pedido update(@RequestBody Pedido pedido)throws SQLException{
+ return pedidoService.update(pedido);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "pedido", allEntries = true)
+ void delete(@PathVariable int id){
+ pedidoService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java
new file mode 100644
index 0000000..a55e68d
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RegionController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Region;
+import pe.edu.pucp.odiparback.services.RegionService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/region")
+@CrossOrigin
+public class RegionController {
+ @Autowired
+ RegionService regionService;
+
+ @GetMapping(value = "/")
+ List<Region> getAll(){
+ return regionService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "region",key = "#id")
+ Region get(@PathVariable int id)throws AuthenticationException{
+ return regionService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Region region)throws SQLException{
+ regionService.register(region);
+ }
+
+ @PutMapping(value = "/")
+ Region update(@RequestBody Region region)throws SQLException{
+ return regionService.update(region);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "region", allEntries = true)
+ void delete(@PathVariable int id){
+ regionService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java
new file mode 100644
index 0000000..096013a
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/RutaController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Ruta;
+import pe.edu.pucp.odiparback.services.RutaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/ruta")
+@CrossOrigin
+public class RutaController {
+ @Autowired
+ RutaService rutaService;
+
+ @GetMapping(value = "/")
+ List<Ruta> getAll(){
+ return rutaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "ruta",key = "#id")
+ Ruta get(@PathVariable int id)throws AuthenticationException{
+ return rutaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Ruta ruta)throws SQLException{
+ rutaService.register(ruta);
+ }
+
+ @PutMapping(value = "/")
+ Ruta update(@RequestBody Ruta ruta)throws SQLException{
+ return rutaService.update(ruta);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "ruta", allEntries = true)
+ void delete(@PathVariable int id){
+ rutaService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java
new file mode 100644
index 0000000..d66f813
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoAveriaController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.TipoAveria;
+import pe.edu.pucp.odiparback.services.TipoAveriaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tipoAveria")
+@CrossOrigin
+public class TipoAveriaController {
+ @Autowired
+ TipoAveriaService tipoAveriaService;
+
+ @GetMapping(value = "/")
+ List<TipoAveria> getAll(){
+ return tipoAveriaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tipoAveria",key = "#id")
+ TipoAveria get(@PathVariable int id)throws AuthenticationException{
+ return tipoAveriaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody TipoAveria tipoAveria)throws SQLException{
+ tipoAveriaService.register(tipoAveria);
+ }
+
+ @PutMapping(value = "/")
+ TipoAveria update(@RequestBody TipoAveria tipoAveria)throws SQLException{
+ return tipoAveriaService.update(tipoAveria);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tipoAveria", allEntries = true)
+ void delete(@PathVariable int id){
+ tipoAveriaService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java
new file mode 100644
index 0000000..72beae9
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TipoCamionController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.TipoCamion;
+import pe.edu.pucp.odiparback.services.TipoCamionService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tipoCamion")
+@CrossOrigin
+public class TipoCamionController {
+ @Autowired
+ TipoCamionService tipoCamionService;
+
+ @GetMapping(value = "/")
+ List<TipoCamion> getAll(){
+ return tipoCamionService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tipoCamion",key = "#id")
+ TipoCamion get(@PathVariable int id)throws AuthenticationException{
+ return tipoCamionService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody TipoCamion tipoCamion)throws SQLException{
+ tipoCamionService.register(tipoCamion);
+ }
+
+ @PutMapping(value = "/")
+ TipoCamion update(@RequestBody TipoCamion tipoCamion)throws SQLException{
+ return tipoCamionService.update(tipoCamion);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tipoCamion", allEntries = true)
+ void delete(@PathVariable int id){
+ tipoCamionService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java
new file mode 100644
index 0000000..05606ad
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Tramo;
+import pe.edu.pucp.odiparback.services.TramoService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tramo")
+@CrossOrigin
+public class TramoController {
+ @Autowired
+ TramoService tramoService;
+
+ @GetMapping(value = "/")
+ List<Tramo> getAll(){
+ return tramoService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tramo",key = "#id")
+ Tramo get(@PathVariable int id)throws AuthenticationException{
+ return tramoService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Tramo tramo)throws SQLException{
+ tramoService.register(tramo);
+ }
+
+ @PutMapping(value = "/")
+ Tramo update(@RequestBody Tramo tramo)throws SQLException{
+ return tramoService.update(tramo);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tramo", allEntries = true)
+ void delete(@PathVariable int id){
+ tramoService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java
new file mode 100644
index 0000000..9c37098
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/TramoRutaController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.TramoRuta;
+import pe.edu.pucp.odiparback.services.TramoRutaService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/tramoRuta")
+@CrossOrigin
+public class TramoRutaController {
+ @Autowired
+ TramoRutaService tramoRutaService;
+
+ @GetMapping(value = "/")
+ List<TramoRuta> getAll(){
+ return tramoRutaService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "tramo",key = "#id")
+ TramoRuta get(@PathVariable int id)throws AuthenticationException{
+ return tramoRutaService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody TramoRuta tramoRuta)throws SQLException{
+ tramoRutaService.register(tramoRuta);
+ }
+
+ @PutMapping(value = "/")
+ TramoRuta update(@RequestBody TramoRuta tramoRuta)throws SQLException{
+ return tramoRutaService.update(tramoRuta);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "tramoRuta", allEntries = true)
+ void delete(@PathVariable int id){
+ tramoRutaService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java
new file mode 100644
index 0000000..aaa9038
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/controllers/UsuarioController.java
@@ -0,0 +1,54 @@
+package pe.edu.pucp.odiparback.controllers;
+import pe.edu.pucp.odiparback.models.Usuario;
+import pe.edu.pucp.odiparback.services.UsuarioService;
+import java.sql.SQLException;
+import java.util.List;
+import org.apache.tomcat.websocket.AuthenticationException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/usuario")
+@CrossOrigin
+public class UsuarioController {
+ @Autowired
+ UsuarioService usuarioService;
+
+ @GetMapping(value = "/")
+ List<Usuario> getAll(){
+ return usuarioService.getAll();
+ }
+
+ @GetMapping(value = "/{id}")
+ @Cacheable(value = "usuario",key = "#id")
+ Usuario get(@PathVariable int id)throws AuthenticationException{
+ return usuarioService.get(id);
+ }
+
+ @PostMapping(value = "/")
+ void register(@RequestBody Usuario usuario)throws SQLException{
+ usuarioService.register(usuario);
+ }
+
+ @PutMapping(value = "/")
+ Usuario update(@RequestBody Usuario usuario)throws SQLException{
+ return usuarioService.update(usuario);
+ }
+
+ @DeleteMapping(value = "/{id}")
+ @CacheEvict(value = "usuario", allEntries = true)
+ void delete(@PathVariable int id){
+ usuarioService.delete(id);
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AlmacenDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AlmacenDao.java
new file mode 100644
index 0000000..e728313
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AlmacenDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Almacen;
+
+
+public interface AlmacenDao {
+ public List<Almacen> getAll();
+ public Almacen get(int id);
+ public void register(Almacen almacen);
+ public Almacen update(Almacen almacen);
+ public void delete(int id);
+} \ No newline at end of file
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AveriaDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AveriaDao.java
new file mode 100644
index 0000000..ebd56d3
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/AveriaDao.java
@@ -0,0 +1,12 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Averia;
+
+public interface AveriaDao {
+ public List<Averia> getAll();
+ public Averia get(int id);
+ public void register(Averia averia);
+ public Averia update(Averia averia);
+ public void delete(int id);
+} \ No newline at end of file
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/CamionDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/CamionDao.java
new file mode 100644
index 0000000..d1a81f1
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/CamionDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Camion;
+
+
+public interface CamionDao {
+ public List<Camion> getAll();
+ public Camion get(int id);
+ public void register(Camion camion);
+ public Camion update(Camion camion);
+ public void delete(int id);
+} \ No newline at end of file
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/ClienteDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/ClienteDao.java
new file mode 100644
index 0000000..531f02c
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/ClienteDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Cliente;
+
+
+public interface ClienteDao {
+ public List<Cliente> getAll();
+ public Cliente get(int id);
+ public void register(Cliente cliente);
+ public Cliente update(Cliente cliente);
+ public void delete(int id);
+} \ No newline at end of file
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java
new file mode 100644
index 0000000..ca6f5b0
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PTGDao.java
@@ -0,0 +1,11 @@
+package pe.edu.pucp.odiparback.dao;
+import java.util.List;
+import pe.edu.pucp.odiparback.models.PTG;
+
+public interface PTGDao {
+ public List<PTG> getAll();
+ public PTG get(int id);
+ public void register(PTG planTransporte);
+ public PTG update(PTG planTransporte);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PedidoDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PedidoDao.java
new file mode 100644
index 0000000..2b619ab
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/PedidoDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Pedido;
+
+
+public interface PedidoDao {
+ public List<Pedido> getAll();
+ public Pedido get(int id);
+ public void register(Pedido pedido);
+ public Pedido update(Pedido pedido);
+ public void delete(int id);
+} \ No newline at end of file
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RegionDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RegionDao.java
new file mode 100644
index 0000000..b4673e1
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RegionDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Region;
+
+
+public interface RegionDao {
+ public List<Region> getAll();
+ public Region get(int id);
+ public void register(Region region);
+ public Region update(Region region);
+ public void delete(int id);
+} \ No newline at end of file
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RutaDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RutaDao.java
new file mode 100644
index 0000000..9dd79d5
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/RutaDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Ruta;
+
+
+public interface RutaDao {
+ public List<Ruta> getAll();
+ public Ruta get(int id);
+ public void register(Ruta ruta);
+ public Ruta update(Ruta ruta);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoAveriaDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoAveriaDao.java
new file mode 100644
index 0000000..2d98140
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoAveriaDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.TipoAveria;
+
+
+public interface TipoAveriaDao {
+ public List<TipoAveria> getAll();
+ public TipoAveria get(int id);
+ public void register(TipoAveria tipoAveria);
+ public TipoAveria update(TipoAveria tipoAveria);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoCamionDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoCamionDao.java
new file mode 100644
index 0000000..4340dfc
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TipoCamionDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.TipoCamion;
+
+
+public interface TipoCamionDao {
+ public List<TipoCamion> getAll();
+ public TipoCamion get(int id);
+ public void register(TipoCamion tipoCamion);
+ public TipoCamion update(TipoCamion tipoCamion);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoDao.java
new file mode 100644
index 0000000..ddd573e
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoDao.java
@@ -0,0 +1,13 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Tramo;
+
+
+public interface TramoDao {
+ public List<Tramo> getAll();
+ public Tramo get(int id);
+ public void register(Tramo tramo);
+ public Tramo update(Tramo tramo);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java
new file mode 100644
index 0000000..5186bc5
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/TramoRutaDao.java
@@ -0,0 +1,11 @@
+package pe.edu.pucp.odiparback.dao;
+import java.util.List;
+import pe.edu.pucp.odiparback.models.TramoRuta;
+
+public interface TramoRutaDao {
+ public List<TramoRuta> getAll();
+ public TramoRuta get(int id);
+ public void register(TramoRuta tramoRuta);
+ public TramoRuta update(TramoRuta tramoRuta);
+ public void delete(int id);
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/UsuarioDao.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/UsuarioDao.java
new file mode 100644
index 0000000..b8b5eca
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/UsuarioDao.java
@@ -0,0 +1,14 @@
+package pe.edu.pucp.odiparback.dao;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.models.Usuario;
+
+
+public interface UsuarioDao {
+ public List<Usuario> getAll();
+ public Usuario get(int id);
+ public void register(Usuario usuario);
+ public Usuario update(Usuario usuario);
+ public void delete(int id);
+}
+
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AlmacenDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AlmacenDaoImp.java
new file mode 100644
index 0000000..575d38a
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AlmacenDaoImp.java
@@ -0,0 +1,87 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Almacen;
+import pe.edu.pucp.odiparback.dao.AlmacenDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class AlmacenDaoImp implements AlmacenDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Almacen> getAll() {
+ List<Almacen> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Almacen";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Almacen get(int id) {
+ Almacen resultado = null;
+ try {
+ resultado = entityManager.find(Almacen.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Almacen almacen) {
+ try {
+ entityManager.merge(almacen);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+ @Transactional
+ @Override
+ public Almacen update(Almacen almacen) {
+ try {
+ entityManager.merge(almacen);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return almacen;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Almacen resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AveriaDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AveriaDaoImp.java
new file mode 100644
index 0000000..1bf1882
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/AveriaDaoImp.java
@@ -0,0 +1,87 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Averia;
+import pe.edu.pucp.odiparback.dao.AveriaDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class AveriaDaoImp implements AveriaDao{
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Averia> getAll() {
+ List<Averia> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Averia";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Averia get(int id) {
+ Averia resultado = null;
+ try {
+ resultado = entityManager.find(Averia.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Averia averia) {
+ try {
+ entityManager.merge(averia);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+ @Transactional
+ @Override
+ public Averia update(Averia averia) {
+ try {
+ entityManager.merge(averia);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return averia;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Averia resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/CamionDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/CamionDaoImp.java
new file mode 100644
index 0000000..4c97808
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/CamionDaoImp.java
@@ -0,0 +1,87 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Camion;
+import pe.edu.pucp.odiparback.dao.CamionDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class CamionDaoImp implements CamionDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Camion> getAll() {
+ List<Camion> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Camion";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Camion get(int id) {
+ Camion resultado = null;
+ try {
+ resultado = entityManager.find(Camion.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Camion camion) {
+ try {
+ entityManager.merge(camion);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+ @Transactional
+ @Override
+ public Camion update(Camion camion) {
+ try {
+ entityManager.merge(camion);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return camion;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Camion resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/ClienteDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/ClienteDaoImp.java
new file mode 100644
index 0000000..2a9ae44
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/ClienteDaoImp.java
@@ -0,0 +1,86 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Cliente;
+import pe.edu.pucp.odiparback.dao.ClienteDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class ClienteDaoImp implements ClienteDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Cliente> getAll() {
+ List<Cliente> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Cliente";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Cliente get(int id) {
+ Cliente resultado = null;
+ try {
+ resultado = entityManager.find(Cliente.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Cliente cliente) {
+ try {
+ entityManager.merge(cliente);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+ @Transactional
+ @Override
+ public Cliente update(Cliente cliente) {
+ try {
+ entityManager.merge(cliente);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return cliente;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Cliente resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PTGDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PTGDaoImp.java
new file mode 100644
index 0000000..ac076cf
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PTGDaoImp.java
@@ -0,0 +1,86 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.PTG;
+import pe.edu.pucp.odiparback.dao.PTGDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class PTGDaoImp implements PTGDao{
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<PTG> getAll() {
+ List<PTG> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_PTG";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public PTG get(int id) {
+ PTG resultado = null;
+ try {
+ resultado = entityManager.find(PTG.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(PTG planTransporte) {
+ try {
+ entityManager.merge(planTransporte);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+ @Transactional
+ @Override
+ public PTG update(PTG planTransporte) {
+ try {
+ entityManager.merge(planTransporte);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return planTransporte;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ PTG resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PedidoDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PedidoDaoImp.java
new file mode 100644
index 0000000..3ebc387
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/PedidoDaoImp.java
@@ -0,0 +1,85 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Pedido;
+import pe.edu.pucp.odiparback.dao.PedidoDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class PedidoDaoImp implements PedidoDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Pedido> getAll() {
+ List<Pedido> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Pedido";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Pedido get(int id) {
+ Pedido resultado = null;
+ try {
+ resultado = entityManager.find(Pedido.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Pedido pedido) {
+ try {
+ entityManager.merge(pedido);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+ @Transactional
+ @Override
+ public Pedido update(Pedido pedido) {
+ try {
+ entityManager.merge(pedido);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return pedido;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Pedido resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RegionDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RegionDaoImp.java
new file mode 100644
index 0000000..15788d4
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RegionDaoImp.java
@@ -0,0 +1,85 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Region;
+import pe.edu.pucp.odiparback.dao.RegionDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class RegionDaoImp implements RegionDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Region> getAll() {
+ List<Region> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Region";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Region get(int id) {
+ Region resultado = null;
+ try {
+ resultado = entityManager.find(Region.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Region region) {
+ try {
+ entityManager.merge(region);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+ @Transactional
+ @Override
+ public Region update(Region region) {
+ try {
+ entityManager.merge(region);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return region;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Region resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RutaDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RutaDaoImp.java
new file mode 100644
index 0000000..0e491b7
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/RutaDaoImp.java
@@ -0,0 +1,85 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Ruta;
+import pe.edu.pucp.odiparback.dao.RutaDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class RutaDaoImp implements RutaDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Ruta> getAll() {
+ List<Ruta> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Ruta";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Ruta get(int id) {
+ Ruta resultado = null;
+ try {
+ resultado = entityManager.find(Ruta.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Ruta ruta) {
+ try {
+ entityManager.merge(ruta);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+ @Transactional
+ @Override
+ public Ruta update(Ruta ruta) {
+ try {
+ entityManager.merge(ruta);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return ruta;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Ruta resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoAveriaDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoAveriaDaoImp.java
new file mode 100644
index 0000000..f2980cf
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoAveriaDaoImp.java
@@ -0,0 +1,85 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.TipoAveria;
+import pe.edu.pucp.odiparback.dao.TipoAveriaDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class TipoAveriaDaoImp implements TipoAveriaDao{
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<TipoAveria> getAll() {
+ List<TipoAveria> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_TipoAveria";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public TipoAveria get(int id) {
+ TipoAveria resultado = null;
+ try {
+ resultado = entityManager.find(TipoAveria.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(TipoAveria tipoAveria) {
+ try {
+ entityManager.merge(tipoAveria);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+ @Transactional
+ @Override
+ public TipoAveria update(TipoAveria tipoAveria) {
+ try {
+ entityManager.merge(tipoAveria);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return tipoAveria;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ TipoAveria resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoCamionDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoCamionDaoImp.java
new file mode 100644
index 0000000..0889570
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TipoCamionDaoImp.java
@@ -0,0 +1,85 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.TipoCamion;
+import pe.edu.pucp.odiparback.dao.TipoCamionDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class TipoCamionDaoImp implements TipoCamionDao{
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<TipoCamion> getAll() {
+ List<TipoCamion> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_TipoCamion";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public TipoCamion get(int id) {
+ TipoCamion resultado = null;
+ try {
+ resultado = entityManager.find(TipoCamion.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(TipoCamion tipoCamion) {
+ try {
+ entityManager.merge(tipoCamion);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+ @Transactional
+ @Override
+ public TipoCamion update(TipoCamion tipoCamion) {
+ try {
+ entityManager.merge(tipoCamion);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return tipoCamion;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ TipoCamion resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoDaoImp.java
new file mode 100644
index 0000000..717dcf2
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoDaoImp.java
@@ -0,0 +1,85 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Tramo;
+import pe.edu.pucp.odiparback.dao.TramoDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class TramoDaoImp implements TramoDao{
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Tramo> getAll() {
+ List<Tramo> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Tramo";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Tramo get(int id) {
+ Tramo resultado = null;
+ try {
+ resultado = entityManager.find(Tramo.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Tramo tramo) {
+ try {
+ entityManager.merge(tramo);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+ @Transactional
+ @Override
+ public Tramo update(Tramo tramo) {
+ try {
+ entityManager.merge(tramo);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return tramo;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Tramo resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoRutaDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoRutaDaoImp.java
new file mode 100644
index 0000000..1808c61
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/TramoRutaDaoImp.java
@@ -0,0 +1,86 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.TramoRuta;
+import pe.edu.pucp.odiparback.dao.TramoRutaDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class TramoRutaDaoImp implements TramoRutaDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<TramoRuta> getAll() {
+ List<TramoRuta> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_TramoRuta";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public TramoRuta get(int id) {
+ TramoRuta resultado = null;
+ try {
+ resultado = entityManager.find(TramoRuta.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(TramoRuta tramoRuta) {
+ try {
+ entityManager.merge(tramoRuta);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ }
+
+ @Transactional
+ @Override
+ public TramoRuta update(TramoRuta tramoRuta) {
+ try {
+ entityManager.merge(tramoRuta);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return tramoRuta;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ TramoRuta resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/UsuarioDaoImp.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/UsuarioDaoImp.java
new file mode 100644
index 0000000..c0e6ef1
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/dao/imp/UsuarioDaoImp.java
@@ -0,0 +1,85 @@
+package pe.edu.pucp.odiparback.dao.imp;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import pe.edu.pucp.odiparback.models.Usuario;
+import pe.edu.pucp.odiparback.dao.UsuarioDao;
+
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+@Repository
+@SuppressWarnings("unchecked")
+public class UsuarioDaoImp implements UsuarioDao{
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public List<Usuario> getAll() {
+ List<Usuario> resultado = null;
+ try{
+ String query = "SELECT * FROM ODP_Usuario";
+ resultado = entityManager.createQuery(query).getResultList();
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public Usuario get(int id) {
+ Usuario resultado = null;
+ try {
+ resultado = entityManager.find(Usuario.class, id);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+
+ return resultado;
+ }
+
+ @Transactional
+ @Override
+ public void register(Usuario usuario) {
+ try {
+ entityManager.merge(usuario);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+ @Transactional
+ @Override
+ public Usuario update(Usuario usuario) {
+ try {
+ entityManager.merge(usuario);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ return usuario;
+ }
+
+ @Transactional
+ @Override
+ public void delete(int id) {
+ Usuario resultado = get(id);
+ try {
+ entityManager.remove(resultado);
+ }
+ catch(Exception ex){
+ System.out.print(ex.getMessage());
+ }
+ }
+
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AlmacenService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AlmacenService.java
new file mode 100644
index 0000000..9bafcd6
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AlmacenService.java
@@ -0,0 +1,33 @@
+package pe.edu.pucp.odiparback.services;
+
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.AlmacenDao;
+import pe.edu.pucp.odiparback.models.Almacen;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AlmacenService {
+ @Autowired
+ AlmacenDao daoAlmacen;
+
+ public List<Almacen> getAll(){
+ return daoAlmacen.getAll();
+ }
+
+ public Almacen get(int id){
+ return daoAlmacen.get(id);
+ }
+
+ public void register(Almacen almacen){
+ daoAlmacen.register(almacen);
+ }
+
+ public Almacen update(Almacen almacen){
+ return daoAlmacen.update(almacen);
+ }
+
+ public void delete(int id){
+ daoAlmacen.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java
new file mode 100644
index 0000000..656452e
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/AveriaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.AveriaDao;
+import pe.edu.pucp.odiparback.models.Averia;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AveriaService {
+ @Autowired
+ AveriaDao daoAveria;
+
+ public List<Averia> getAll(){
+ return daoAveria.getAll();
+ }
+
+ public Averia get(int id){
+ return daoAveria.get(id);
+ }
+
+ public void register(Averia averia){
+ daoAveria.register(averia);
+ }
+
+ public Averia update(Averia averia){
+ return daoAveria.update(averia);
+ }
+
+ public void delete(int id){
+ daoAveria.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java
new file mode 100644
index 0000000..eabf02f
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/CamionService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.CamionDao;
+import pe.edu.pucp.odiparback.models.Camion;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class CamionService {
+ @Autowired
+ CamionDao daoCamion;
+
+ public List<Camion> getAll(){
+ return daoCamion.getAll();
+ }
+
+ public Camion get(int id){
+ return daoCamion.get(id);
+ }
+
+ public void register(Camion camion){
+ daoCamion.register(camion);
+ }
+
+ public Camion update(Camion camion){
+ return daoCamion.update(camion);
+ }
+
+ public void delete(int id){
+ daoCamion.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java
new file mode 100644
index 0000000..2e8eb1b
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/ClienteService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.ClienteDao;
+import pe.edu.pucp.odiparback.models.Cliente;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ClienteService {
+ @Autowired
+ ClienteDao daoCliente;
+
+ public List<Cliente> getAll(){
+ return daoCliente.getAll();
+ }
+
+ public Cliente get(int id){
+ return daoCliente.get(id);
+ }
+
+ public void register(Cliente cliente){
+ daoCliente.register(cliente);
+ }
+
+ public Cliente update(Cliente cliente){
+ return daoCliente.update(cliente);
+ }
+
+ public void delete(int id){
+ daoCliente.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java
new file mode 100644
index 0000000..1c7bfd0
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PTGService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.PTGDao;
+import pe.edu.pucp.odiparback.models.PTG;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class PTGService {
+ @Autowired
+ PTGDao daoPTG;
+
+ public List<PTG> getAll(){
+ return daoPTG.getAll();
+ }
+
+ public PTG get(int id){
+ return daoPTG.get(id);
+ }
+
+ public void register(PTG planTransporte){
+ daoPTG.register(planTransporte);
+ }
+
+ public PTG update(PTG planTransporte){
+ return daoPTG.update(planTransporte);
+ }
+
+ public void delete(int id){
+ daoPTG.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java
new file mode 100644
index 0000000..e0ca661
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/PedidoService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.PedidoDao;
+import pe.edu.pucp.odiparback.models.Pedido;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class PedidoService {
+ @Autowired
+ PedidoDao daoPedido;
+
+ public List<Pedido> getAll(){
+ return daoPedido.getAll();
+ }
+
+ public Pedido get(int id){
+ return daoPedido.get(id);
+ }
+
+ public void register(Pedido pedido){
+ daoPedido.register(pedido);
+ }
+
+ public Pedido update(Pedido pedido){
+ return daoPedido.update(pedido);
+ }
+
+ public void delete(int id){
+ daoPedido.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java
new file mode 100644
index 0000000..3f0f226
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RegionService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.RegionDao;
+import pe.edu.pucp.odiparback.models.Region;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class RegionService {
+ @Autowired
+ RegionDao daoRegion;
+
+ public List<Region> getAll(){
+ return daoRegion.getAll();
+ }
+
+ public Region get(int id){
+ return daoRegion.get(id);
+ }
+
+ public void register(Region region){
+ daoRegion.register(region);
+ }
+
+ public Region update(Region region){
+ return daoRegion.update(region);
+ }
+
+ public void delete(int id){
+ daoRegion.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java
new file mode 100644
index 0000000..0055ae8
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/RutaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.RutaDao;
+import pe.edu.pucp.odiparback.models.Ruta;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class RutaService {
+ @Autowired
+ RutaDao daoRuta;
+
+ public List<Ruta> getAll(){
+ return daoRuta.getAll();
+ }
+
+ public Ruta get(int id){
+ return daoRuta.get(id);
+ }
+
+ public void register(Ruta ruta){
+ daoRuta.register(ruta);
+ }
+
+ public Ruta update(Ruta ruta){
+ return daoRuta.update(ruta);
+ }
+
+ public void delete(int id){
+ daoRuta.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java
new file mode 100644
index 0000000..6cb7719
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoAveriaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TipoAveriaDao;
+import pe.edu.pucp.odiparback.models.TipoAveria;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TipoAveriaService {
+ @Autowired
+ TipoAveriaDao daoTipoAveria;
+
+ public List<TipoAveria> getAll(){
+ return daoTipoAveria.getAll();
+ }
+
+ public TipoAveria get(int id){
+ return daoTipoAveria.get(id);
+ }
+
+ public void register(TipoAveria tipoAveria){
+ daoTipoAveria.register(tipoAveria);
+ }
+
+ public TipoAveria update(TipoAveria tipoAveria){
+ return daoTipoAveria.update(tipoAveria);
+ }
+
+ public void delete(int id){
+ daoTipoAveria.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java
new file mode 100644
index 0000000..fd7b811
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TipoCamionService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TipoCamionDao;
+import pe.edu.pucp.odiparback.models.TipoCamion;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TipoCamionService {
+ @Autowired
+ TipoCamionDao daoTipoCamion;
+
+ public List<TipoCamion> getAll(){
+ return daoTipoCamion.getAll();
+ }
+
+ public TipoCamion get(int id){
+ return daoTipoCamion.get(id);
+ }
+
+ public void register(TipoCamion tipoCamion){
+ daoTipoCamion.register(tipoCamion);
+ }
+
+ public TipoCamion update(TipoCamion tipoCamion){
+ return daoTipoCamion.update(tipoCamion);
+ }
+
+ public void delete(int id){
+ daoTipoCamion.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java
new file mode 100644
index 0000000..2348992
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoRutaService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TramoRutaDao;
+import pe.edu.pucp.odiparback.models.TramoRuta;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TramoRutaService {
+ @Autowired
+ TramoRutaDao daoTramoRuta;
+
+ public List<TramoRuta> getAll(){
+ return daoTramoRuta.getAll();
+ }
+
+ public TramoRuta get(int id){
+ return daoTramoRuta.get(id);
+ }
+
+ public void register(TramoRuta tramoRuta){
+ daoTramoRuta.register(tramoRuta);
+ }
+
+ public TramoRuta update(TramoRuta tramoRuta){
+ return daoTramoRuta.update(tramoRuta);
+ }
+
+ public void delete(int id){
+ daoTramoRuta.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java
new file mode 100644
index 0000000..13fc5b2
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/TramoService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.TramoDao;
+import pe.edu.pucp.odiparback.models.Tramo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class TramoService {
+ @Autowired
+ TramoDao daoTramo;
+
+ public List<Tramo> getAll(){
+ return daoTramo.getAll();
+ }
+
+ public Tramo get(int id){
+ return daoTramo.get(id);
+ }
+
+ public void register(Tramo tramo){
+ daoTramo.register(tramo);
+ }
+
+ public Tramo update(Tramo tramo){
+ return daoTramo.update(tramo);
+ }
+
+ public void delete(int id){
+ daoTramo.delete(id);
+ }
+}
diff --git a/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java
new file mode 100644
index 0000000..c7215ad
--- /dev/null
+++ b/back/odiparback/src/main/java/pe/edu/pucp/odiparback/services/UsuarioService.java
@@ -0,0 +1,32 @@
+package pe.edu.pucp.odiparback.services;
+import java.util.List;
+import pe.edu.pucp.odiparback.dao.UsuarioDao;
+import pe.edu.pucp.odiparback.models.Usuario;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class UsuarioService {
+ @Autowired
+ UsuarioDao daoUsuario;
+
+ public List<Usuario> getAll(){
+ return daoUsuario.getAll();
+ }
+
+ public Usuario get(int id){
+ return daoUsuario.get(id);
+ }
+
+ public void register(Usuario usuario){
+ daoUsuario.register(usuario);
+ }
+
+ public Usuario update(Usuario usuario){
+ return daoUsuario.update(usuario);
+ }
+
+ public void delete(int id){
+ daoUsuario.delete(id);
+ }
+}
diff --git a/test/LAB_5_ACC_2021_1.ipynb b/test/LAB_5_ACC_2021_1.ipynb
new file mode 100644
index 0000000..8eed3f8
--- /dev/null
+++ b/test/LAB_5_ACC_2021_1.ipynb
@@ -0,0 +1,700 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "2VP6d4IEg-qk"
+ },
+ "source": [
+ "# APLICACIONES EN CIENCIAS DE COMPUTACION"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "s4LxYBghg-qy"
+ },
+ "source": [
+ "## Laboratorio 5: Algoritmo genético\n",
+ "Indicaciones previas:\n",
+ "- Las respuestas deben tener un buen fundamento teórico, se realizarán descuentos en el puntaje a respuestas que no contesten a lo solicitado\n",
+ "- Cualquier indicio de plagio resultará en la anulación de la prueba.\n",
+ "\n",
+ "La tarea de este laboratorio consiste en comparar métodos en la elaboración de un algoritmo genético para la resolución de la asignación de vuelos.<br>Al final de este notebook se encuentran las preguntas que serán evaluadas en este laboratorio. \n",
+ "\n",
+ "\n",
+ "#### Representacion de Individuo:\n",
+ "\n",
+ "Un objeto Individual representaa una determinada asignacion de un subconjunto de vuelos (almacenado en <b>list_of_flights</b>) a un conjunto de gates (almacenado en <b>chromosome</b>). La lista de gates disponibles que se pueden asignar a los vuelos se almacena en la variable <b>allele_pool</b> del individuo. Ver el siguiente grafico ilustrativo:\n",
+ "\n",
+ "<img src=\"EjemploIndividuo.png\">\n",
+ "\n",
+ "**Usted deberá completar el código en las secciones indicadas con ######### COMPLETAR #########**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "3BiTFdyNhskY"
+ },
+ "outputs": [],
+ "source": [
+ "from random import seed, randint, sample, uniform, randrange\n",
+ "from copy import deepcopy"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "IRVDEMS3g-q1"
+ },
+ "source": [
+ "### Clase <b>Individual</b>\n",
+ "\n",
+ "Esta es una clase para definir a un individuo de la población. Cada individuo posee un cromosoma, los vuelos a asignar, todos los posibles alelos y su respectivo fitness. Además, los métodos de esta clase permiten realizar el cruzamiento (crossover) y la mutación (mutation) sobre el cromosoma del individuo."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "wD-qU6LnGM8_"
+ },
+ "outputs": [],
+ "source": [
+ "class Individual(object):\n",
+ " \"\"\" Clase que implementa el individuo y sus operadores. El cromosoma de un individuo es una lista de caracteres,\n",
+ " cada elemento de la lista es un gen cuyos alelos (caracteres) posibles se indican en allele_pool\"\"\"\n",
+ "\n",
+ " def __init__(self, chromosome, list_of_flights, allele_pool): # El constructor recibe el cromosoma y el pool de alelos posibles\n",
+ " self.chromosome = chromosome[:]\n",
+ " self.list_of_flights = list_of_flights[:]\n",
+ " self.allele_pool = allele_pool\n",
+ " self.fitness = -1 # -1 indica que el individuo no ha sido evaluado\n",
+ "\n",
+ " def crossover_onepoint(self, other):\n",
+ " \"Retorna dos nuevos individuos del cruzamiento de un punto entre individuos self y other \"\n",
+ " c = randrange(len(self.chromosome))\n",
+ " ind1 = Individual(self.chromosome[:c] + other.chromosome[c:], self.list_of_flights, self.allele_pool)\n",
+ " ind2 = Individual(other.chromosome[:c] + self.chromosome[c:], self.list_of_flights, self.allele_pool)\n",
+ " return [ind1, ind2]\n",
+ " \n",
+ " def crossover_permutation(self, other):\n",
+ " new_list = list(set(self.chromosome + other.chromosome))\n",
+ " flights_to_assign = len(self.list_of_flights)\n",
+ " ind1 = Individual(sample(new_list, flights_to_assign), self.list_of_flights, self.allele_pool)\n",
+ " ind2 = Individual(sample(new_list, flights_to_assign), self.list_of_flights, self.allele_pool)\n",
+ " return [ind1, ind2]\n",
+ " \n",
+ " def crossover_uniform(self, other):\n",
+ " chromosome1 = []\n",
+ " chromosome2 = []\n",
+ " \"Retorna dos nuevos individuos del cruzamiento uniforme entre self y other \"\n",
+ " for i in range(len(self.chromosome)):\n",
+ " if uniform(0, 1) < 0.5:\n",
+ " chromosome1.append(self.chromosome[i])\n",
+ " chromosome2.append(other.chromosome[i])\n",
+ " else:\n",
+ " chromosome1.append(other.chromosome[i])\n",
+ " chromosome2.append(self.chromosome[i])\n",
+ " ind1 = Individual(chromosome1, self.list_of_flights, self.allele_pool)\n",
+ " ind2 = Individual(chromosome2, self.list_of_flights, self.allele_pool)\n",
+ " return [ind1, ind2]\n",
+ "\n",
+ " def mutate_swap(self):\n",
+ " \"Escoge dos genes e intercambia sus alelos\"\n",
+ " mutated_chromosome = deepcopy(self.chromosome)\n",
+ " mutGen1 = randrange(0, len(mutated_chromosome))\n",
+ " mutGen2 = randrange(0, len(mutated_chromosome))\n",
+ " temp = mutated_chromosome[mutGen1]\n",
+ " mutated_chromosome[mutGen1] = mutated_chromosome[mutGen2]\n",
+ " mutated_chromosome[mutGen2] = temp\n",
+ " return Individual(mutated_chromosome, self.list_of_flights, self.allele_pool)\n",
+ " \n",
+ " def mutate_position(self):\n",
+ " \"Cambia aleatoriamente el alelo de un gen.\"\n",
+ " mutated_chromosome = deepcopy(self.chromosome)\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " return Individual(mutated_chromosome, self.list_of_flights, self.allele_pool)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "c8x_4uA5i9XT"
+ },
+ "source": [
+ "### Clase <b>Gate</b>\n",
+ "\n",
+ "Esta es una clase abstracta para definir los lugares donde los vuelos serán asignados. Se debe hacer subclases con el fin de diferenciar los tipos de lugar donde un vuelo puede ser asignado."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "rycIj2j6i_PZ"
+ },
+ "outputs": [],
+ "source": [
+ "class Gate(object):\n",
+ " def __init__(self, identifier, x, y, z):\n",
+ " self.identifier = identifier\n",
+ " self.distance = x\n",
+ " self.potential_of_speed = y\n",
+ " self.number_of_persons_every_10m = z\n",
+ " \n",
+ " def __hash__(self):\n",
+ " return self.identifier"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "fbHPYQ4qj6fb"
+ },
+ "source": [
+ "### Clase <b>Sleeve</b>\n",
+ "\n",
+ "Esta clase implementa concretamente el Gate tipo Sleeve (Manga). En este tipo de gate, los pasajeros deben realizar un recorrido a pie hasta abandonar totalmente el Gate. Se tiene en cuenta la longitud de la manga, la velocidad de los pasajeros y la cantidad de personas que pueden estar cada 10m (este valor es variable porque ya refleja el ancho de la manga, puesto que una manga más ancha permite una mayor cantidad de pasajeros)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "E9XCmO-3j472"
+ },
+ "outputs": [],
+ "source": [
+ "class Sleeve(Gate):\n",
+ " def __init__(self, identifier, length_of_sleeve, speed_of_passengers_on_sleeve, number_of_passengers_every_10m):\n",
+ " super().__init__(identifier, length_of_sleeve, speed_of_passengers_on_sleeve, number_of_passengers_every_10m)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "0T5fySg6lytA"
+ },
+ "source": [
+ "### Clase <b>Zone</b>\n",
+ "\n",
+ "Esta clase implementa concretamente el Gate tipo Zone (zona). En este tipo de gate, los pasajeros son recogidos por un bus y son llevados hasta una puerta. Se tiene en cuenta la distancia de la zona a la puerta, la velocidad y capacidad del bus."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "yzwjyLG_l0nz"
+ },
+ "outputs": [],
+ "source": [
+ "class Zone(Gate):\n",
+ " def __init__(self, identifier, distance_zone_door, speed_bus, capacity_of_bus):\n",
+ " super().__init__(identifier, distance_zone_door, speed_bus, capacity_of_bus)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "ieZ9wq8amMgT"
+ },
+ "source": [
+ "### Clase <b>Flight</b>\n",
+ "\n",
+ "Esta es una clase para definir a los vuelos a asignar. Cada vuelo posee una capacidad máxima, la cantidad de pasajeros, el tiempo de estacionamiento que le toma al vuelo, la longitud de las alas del avión, el tiempo de inspección al avión luego de aterrizar, el tiempo que demorarían en bajar las escaleras los pasajeros si el avión estuviera repleto, el momento de llegada al aeropuerto y el momento en que debería irse del aeropuerto."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "3Nt88YPkmLb7"
+ },
+ "outputs": [],
+ "source": [
+ "class Flight(object):\n",
+ " def __init__(self, identifier, maximum_capacity, number_of_passengers, parking_time, length_wings, inspection_time, landing_time_on_stairs, arriving_time, leaving_time):\n",
+ " self.identifier = identifier\n",
+ " self.maximum_capacity = maximum_capacity\n",
+ " self.number_of_passengers = number_of_passengers\n",
+ " self.parking_time = parking_time\n",
+ " self.length_wings = length_wings\n",
+ " self.inspection_time = inspection_time\n",
+ " self.landing_time_on_stairs = landing_time_on_stairs\n",
+ " self.arriving_time = arriving_time\n",
+ " self.leaving_time = leaving_time\n",
+ " \n",
+ " def __hash__(self):\n",
+ " return self.identifier"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "tJ5cKDEOg-q4"
+ },
+ "source": [
+ "### Funciones utilitarias para generar los Gates y Vuelos</b>\n",
+ "Estas son funciones utilitarias para generar automáticamente los Gates y Vuelos"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "k8p8en78FCcq"
+ },
+ "outputs": [],
+ "source": [
+ "def generate_list_of_gates(number_of_gates, max_length_of_sleeve=20, max_speed_of_passengers_on_sleeve=3, max_number_of_passengers_every_10m=12, max_distance_zone_door=50, max_speed_bus=15, max_capacity_of_bus=200):\n",
+ " list_of_gates = list()\n",
+ "\n",
+ " for gate_identifier in range(number_of_gates):\n",
+ " gate_type = randint(0, 1)\n",
+ "\n",
+ " if gate_type == 0:\n",
+ " distance = randint(1, max_length_of_sleeve)\n",
+ " potential_of_speed = randint(1, max_speed_of_passengers_on_sleeve)\n",
+ " number_of_persons_every_10m = randint(1, max_number_of_passengers_every_10m)\n",
+ "\n",
+ " gate = Sleeve(gate_identifier, distance, potential_of_speed, number_of_persons_every_10m)\n",
+ " else:\n",
+ " distance = randint(1, max_distance_zone_door)\n",
+ " potential_of_speed = randint(1, max_speed_bus)\n",
+ " number_of_persons_every_10m = randint(1, max_capacity_of_bus)\n",
+ "\n",
+ " gate = Zone(gate_identifier, distance, potential_of_speed, number_of_persons_every_10m)\n",
+ " \n",
+ " list_of_gates.append(gate)\n",
+ " \n",
+ " return list_of_gates\n",
+ "\n",
+ "def generate_list_of_flights(number_of_flights, max_maximum_capacity=100, max_number_of_passengers_factor=0.8, max_parking_time=30, max_length_wings=25, max_inspection_time=180, max_landing_time_on_stairs=60, max_arriving_time=200, max_leaving_time=1000):\n",
+ " list_of_flights = list()\n",
+ "\n",
+ " max_number_of_passengers = max_number_of_passengers_factor * max_maximum_capacity\n",
+ "\n",
+ " for flight_identifier in range(number_of_flights):\n",
+ " maximum_capacity = randint(max_number_of_passengers, max_maximum_capacity)\n",
+ " number_of_passengers = randint(1, max_number_of_passengers)\n",
+ " parking_time = randint(1, max_parking_time)\n",
+ " length_wings = randint(1, max_length_wings)\n",
+ " inspection_time = randint(1, max_inspection_time)\n",
+ " landing_time_on_stairs = randint(1, max_landing_time_on_stairs)\n",
+ " arriving_time = randint(1, max_arriving_time)\n",
+ " leaving_time = randint(max_arriving_time + 1, max_leaving_time)\n",
+ "\n",
+ " flight = Flight(flight_identifier, maximum_capacity, number_of_passengers, parking_time, length_wings, inspection_time, landing_time_on_stairs, arriving_time, leaving_time)\n",
+ " \n",
+ " list_of_flights.append(flight)\n",
+ " \n",
+ " return list_of_flights"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "uHsytNf6oaXJ"
+ },
+ "source": [
+ "### Funciones utilitarias para ordenar los Vuelos y Gates</b>\n",
+ "Estas son funciones utilitarias para ordenar los Vuelos acorde a su deseabilidad y los Gates por su flujo personas"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "25baejsnob3d"
+ },
+ "outputs": [],
+ "source": [
+ "def process_desirability(n):\n",
+ " return n.number_of_passengers / (n.leaving_time - n.arriving_time)\n",
+ "\n",
+ "def process_flow(n):\n",
+ " return n.number_of_persons_every_10m * n.potential_of_speed * 10 / n.distance"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "Gqws5RELpMG1"
+ },
+ "source": [
+ "### Funciones utilitarias para el Algoritmo Genético</b>\n",
+ "Estas son funciones utilitarias para realizar el Algoritmo Genético que se encargue de la asignación de vuelos"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "Glf8GsaujEF6"
+ },
+ "outputs": [],
+ "source": [
+ "# Inicialización aleatoria de la población\n",
+ "def init_population(population_number, flights_to_assign, allele_pool, list_of_flights):\n",
+ " population = []\n",
+ " for i in range(population_number):\n",
+ " new_chromosome_for_individual = sample(allele_pool, flights_to_assign)\n",
+ " list_of_flights_for_individual = sample(list_of_flights, flights_to_assign)\n",
+ " population.append( Individual(new_chromosome_for_individual, list_of_flights_for_individual, allele_pool) )\n",
+ " return population\n",
+ "\n",
+ "# Funcion de fitness: evalua un individuo dada su lista de vuelos (solution_flights) y los gates asignados (solution_gates)\n",
+ "# El fitness representa la suma total de ratios de numeros de pasajeros desembarcados por unidad de tiempo en cada gate asignado \n",
+ "def fitness(solution_flights, solution_gates):\n",
+ " grace_time = 5/100\n",
+ "\n",
+ " cumulative_time = 0\n",
+ " for flight, gate in zip(solution_flights, solution_gates):\n",
+ " number_of_passengers = flight.number_of_passengers\n",
+ " if isinstance(gate, Sleeve):\n",
+ " disembarkation_time_of_passengers = ( (number_of_passengers * (gate.distance + flight.length_wings) / process_flow(gate)) + flight.parking_time + flight.inspection_time ) * (1 + grace_time)\n",
+ " else:\n",
+ " disembarkation_time_of_passengers = ( (number_of_passengers * gate.distance / process_flow(gate)) + flight.parking_time + (flight.landing_time_on_stairs * number_of_passengers / flight.maximum_capacity) + flight.inspection_time ) * (1 + grace_time)\n",
+ " cumulative_time += number_of_passengers / disembarkation_time_of_passengers\n",
+ " return cumulative_time\n",
+ "\n",
+ "# Evaluar la población con la función fitness\n",
+ "def evaluate_population(population, fitness_fn):\n",
+ " \"\"\" Evalua una poblacion de individuos con la funcion de fitness pasada \"\"\"\n",
+ " population_size = len(population)\n",
+ " for i in range(population_size):\n",
+ " if population[i].fitness == -1: # Evalúa sólo si el individuo no esta evaluado\n",
+ " population[i].fitness = fitness_fn(population[i].list_of_flights, population[i].chromosome)\n",
+ "\n",
+ "# Selección de parientes por el método roulette\n",
+ "def select_parents_roulette(population):\n",
+ " population_size = len(population)\n",
+ " \n",
+ " sumfitness = sum([indiv.fitness for indiv in population])\n",
+ " pickfitness = uniform(0, sumfitness)\n",
+ " cumfitness = 0\n",
+ " for i in range(population_size):\n",
+ " cumfitness += population[i].fitness\n",
+ " if cumfitness > pickfitness: \n",
+ " iParent1 = i\n",
+ " break\n",
+ " \n",
+ " sumfitness = sumfitness - population[iParent1].fitness\n",
+ " pickfitness = uniform(0, sumfitness)\n",
+ " cumfitness = 0\n",
+ " for i in range(population_size):\n",
+ " if i == iParent1:\n",
+ " continue\n",
+ " cumfitness += population[i].fitness\n",
+ " if cumfitness > pickfitness: \n",
+ " iParent2 = i\n",
+ " break\n",
+ " return (population[iParent1], population[iParent2])\n",
+ "\n",
+ "# Selección de parientes por el método tournament\n",
+ "def select_parents_tournament(population, percentage_size):\n",
+ " population_size = len(population)\n",
+ " tournament_size = int(percentage_size*population_size/100)\n",
+ " \n",
+ " # Escoge el primer padre\n",
+ " tournament_pool = sample(population, tournament_size)\n",
+ " max_fitness = -1\n",
+ " for i in range(len(tournament_pool)): # recorre los individuos que participan en el torneo buscando el mejor individuo\n",
+ " if tournament_pool[i].fitness > max_fitness:\n",
+ " max_fitness = tournament_pool[i].fitness\n",
+ " iParent1 = i\n",
+ " \n",
+ " # Escoge el segundo padre\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " return (population[iParent1], population[iParent2])\n",
+ "\n",
+ "# Selección de la nueva población\n",
+ "def select_survivors(population, offspring_population, numsurvivors):\n",
+ " next_population = []\n",
+ " population.extend(offspring_population) # Une las dos poblaciones\n",
+ " survivors = sorted(population, key=lambda x: x.fitness, reverse=True)[:numsurvivors]\n",
+ " next_population.extend(survivors)\n",
+ " return next_population\n",
+ "\n",
+ "def genetic_algorithm(list_of_flights, list_of_gates, num_individuals, flights_to_assign, fitness_fn, n_generations, selection_fn=\"roulette\", crossover=\"onepoint\", mutation=\"position\", percentage_size=5, p_mut=0.05):\n",
+ " seed(0)\n",
+ "\n",
+ " allele_pool = list_of_gates\n",
+ "\n",
+ " #Inicializa una poblacion inicial de forma aleatoria\n",
+ " population = init_population(num_individuals, flights_to_assign, allele_pool, list_of_flights)\n",
+ "\n",
+ " population_size = len(population)\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " \n",
+ " for _ in range(n_generations): # Por cada generacion\n",
+ " \n",
+ " ## Selecciona las parejas de padres para cruzamiento\n",
+ " mating_pool = []\n",
+ " for i in range(int(population_size/2)):\n",
+ " if selection_fn == \"roulette\":\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " elif selection_fn == \"tournament\":\n",
+ " mating_pool.append(select_parents_tournament(population, percentage_size))\n",
+ "\n",
+ " ## Crea la poblacion descendencia cruzando las parejas del mating pool \n",
+ " offspring_population = []\n",
+ " for i in range(len(mating_pool)):\n",
+ " if crossover == \"onepoint\":\n",
+ " offspring_population.extend( mating_pool[i][0].crossover_onepoint(mating_pool[i][1]) )\n",
+ " elif crossover == \"permutation\":\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " elif crossover == \"uniform\":\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " \n",
+ " ## Aplica el operador de mutacion con probabilidad p_mut en cada hijo generado\n",
+ " for i in range(len(offspring_population)):\n",
+ " if uniform(0, 1) < p_mut: \n",
+ " if mutation == \"swap\":\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " elif mutation == \"position\":\n",
+ " offspring_population[i] = offspring_population[i].mutate_position()\n",
+ "\n",
+ " ######### COMPLETAR #########\n",
+ " ....\n",
+ " \n",
+ " best = sorted(population, key=lambda x: x.fitness, reverse=True)[0]\n",
+ "\n",
+ " return best"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "pc90jPukpbwN"
+ },
+ "source": [
+ "### Funciones utilitarias para manejar la solución del Algoritmo Genético</b>\n",
+ "Esta es una función utilitarias que permite mostrar la configuración usada en el Algoritmo Genético y la asignación de Vuelos a Gates encontrada en la solución"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "yb6LUKwKpXDJ"
+ },
+ "outputs": [],
+ "source": [
+ "def make_solution_report(solution, selection_fn, crossover, mutation):\n",
+ " print(\"Selection: {} - Crossover: {} - Mutation: {} - Fitness: {}\".format(selection_fn, crossover, mutation, solution.fitness), flush=True)\n",
+ " print(\" - \".join([\"Flight {} in {} {}\".format(flight.identifier, \"Zone\" if isinstance(gate, Zone) == True else \"Sleeve\", gate.identifier) for flight, gate in zip(solution.list_of_flights, solution.chromosome)]) + \"\\n\", flush=True)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "qYjVdTfeg-q6"
+ },
+ "source": [
+ "## <b>Algoritmo Genético</b> "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "1m0pxINHqQ2m"
+ },
+ "source": [
+ "### <b>Generación de Gates y Vuelos</b> \n",
+ "\n",
+ "Implementación para generar los Gates y Vuelos, **sin filtrar los primeros N vuelos más deseables que pueden ser asignados, dejando el trabajo de selección de vuelos al Algoritmo Genético**"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "DaqP5VHngUVg"
+ },
+ "outputs": [],
+ "source": [
+ "seed(0)\n",
+ "\n",
+ "number_of_gates = 7\n",
+ "number_of_flights = 20\n",
+ "\n",
+ "list_of_gates = generate_list_of_gates(number_of_gates)\n",
+ "list_of_flights = generate_list_of_flights(number_of_flights)\n",
+ "\n",
+ "number_of_gates = len(list_of_gates)\n",
+ "number_of_flights = len(list_of_flights)\n",
+ "\n",
+ "flights_to_assign = number_of_flights if number_of_flights <= number_of_gates\telse number_of_gates\n",
+ " \n",
+ "list_of_flights = sorted(list_of_flights, key=process_desirability, reverse=True)\n",
+ "list_of_gates = sorted(list_of_gates, key=process_flow, reverse=True)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "PmmLPnvYrP6v"
+ },
+ "source": [
+ "### <b>Experimentación con el Algoritmo Genético</b> "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "CnfOnMijrP6x"
+ },
+ "outputs": [],
+ "source": [
+ "num_individuals = 100\n",
+ "\n",
+ "fitness_fn = fitness\n",
+ "n_generations = 20\n",
+ "\n",
+ "best_fitness = 0\n",
+ "\n",
+ "selection_fn = \"roulette\"\n",
+ "crossover = \"onepoint\"\n",
+ "mutation = \"position\"\n",
+ "\n",
+ "solution = genetic_algorithm(list_of_flights, list_of_gates, num_individuals, flights_to_assign, fitness_fn, n_generations, selection_fn, crossover, mutation)\n",
+ "\n",
+ "make_solution_report(solution, selection_fn, crossover, mutation)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "wDZA5IJ5gUVh"
+ },
+ "outputs": [],
+ "source": [
+ "num_individuals = 100\n",
+ "\n",
+ "fitness_fn = fitness\n",
+ "n_generations = 20\n",
+ "\n",
+ "best_fitness = 0\n",
+ "\n",
+ "######### COMPLETAR #########\n",
+ "for selection_fn in [\"roulette\", \"tournament\"]: # por cada operador de seleccion\n",
+ " for crossover in [....]: # por cada operador de cruzamiento\n",
+ " for mutation in [....]: # por cada operador de mutacion\n",
+ " ....\n",
+ "\n",
+ "print(\"Best Fitness: {}\".format(best_fitness))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "JnfUrB-aqegj"
+ },
+ "source": [
+ "# Preguntas:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "yZHjKv4Lyfa2"
+ },
+ "source": [
+ "**1.** Completar el código\n",
+ "\n",
+ "**(4 Puntos)**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "xCdMlpt1vpJj"
+ },
+ "source": [
+ "**2.** Para la \"Generación de Gates y Vuelos\", experimentar con el algoritmo genético usando las siguientes configuraciones:\n",
+ "\n",
+ "- selection_fn: \"roulette\", \"tournament\"\n",
+ "- crossover: \"onepoint\", \"uniform\", \"permutation\"\n",
+ "- mutation: \"position\", \"swap\"\n",
+ "\n",
+ "En total son 12 combinaciones a realizar. En cada configuración se debe usar la función \"make_solution_report\" para obtener los resultados. La lista de Vuelos y Gates sólo se generan 1 vez, a partir de las cuales se experimenta con cada configuración del Algoritmo Genético.\n",
+ "\n",
+ "**No modificar los valores de \"percentage_size\" y \"p_mut\" al ejecutar el algoritmo genético**\n",
+ "\n",
+ "**Se debe mostrar el código respectivo y la solución generada en cada configuración o se considerará como inválido. Para este fin, puede agregar celdas a su gusto.**\n",
+ "\n",
+ "**(5 Puntos, cada 3 configuraciones realizadas equivale a 1 punto)**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "iobk9RW2vtcr"
+ },
+ "source": [
+ "**3.** Para la \"Generación de Gates y Vuelos no restringida\", seleccionar las soluciones con el mejor fitness.\n",
+ "\n",
+ "**En total debería tener 5 configuraciones con el mejor fitness (contando todos los decimales devueltos en la impresión de make_solution_report**\n",
+ "\n",
+ "**(5 Puntos, cada configuración explicada equivale a 1 punto)**"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "h1-xDv92SYnF"
+ },
+ "source": [
+ "**4.** Por cada solución (de la pregunta 3), explicar teóricamente porque dicha configuración (\"selection_fn\", \"crossover\" y \"mutation\") obtiene el mejor fitness. Se debe tener en cuenta que en este caso el Algoritmo Genético se encargó de elegir los vuelos a ser asignados.\n",
+ "\n",
+ "**Es necesario que indique en que parte del código el Algoritmo Genético eligió los vuelos, o las justificaciones teóricas no se considerarán válidas.**\n",
+ "\n",
+ "**Se debe explicar teóricamente cada configuración por separado, o se considerará como inválido.**\n",
+ "\n",
+ "**En total debería tener 5 configuraciones con el mejor fitness (contando todos los decimales devueltos en la impresión de make_solution_report**\n",
+ "\n",
+ "**(6 Puntos, indicar la parte del código el Algoritmo Genético eligió los vuelos equivale 1 punto, y cada configuración explicada equivale a 1 punto)**"
+ ]
+ }
+ ],
+ "metadata": {
+ "colab": {
+ "collapsed_sections": [],
+ "name": "LAB_5_ACC_2021_1.ipynb",
+ "provenance": []
+ },
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.8.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 1
+}