diff --git a/README.md b/README.md deleted file mode 100644 index 23e83a8..0000000 --- a/README.md +++ /dev/null @@ -1,16 +0,0 @@ -Vehical-Routing-Problem -======================= - -Vehical Routing Problem solver. -This is a small program which is able to solve VRP using two basic alogirthms: -- Sweep algorithm -- Clark & Wright's algorithm. - -There are two versions. One written in Java, which runs as console applications and another one which is also written in Java but compiled to JavaScript using GWT. -The GWT version uses Google Maps in order to visualize the results. - -You can get some more info about the tool at my blog page: -http://www.hoonzis.com/vehicle-routing-problem - -The working GWT version of the application is available here: -http://hoonzis.github.com/Vehical-Routing-Problem/vrp/ \ No newline at end of file diff --git a/gwt/.classpath b/gwt/.classpath deleted file mode 100644 index 093de7d..0000000 --- a/gwt/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/gwt/.project b/gwt/.project deleted file mode 100644 index 0aae76d..0000000 --- a/gwt/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - VRPGui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.google.gwt.eclipse.core.gwtProjectValidator - - - - - com.google.gdt.eclipse.core.webAppProjectValidator - - - - - - org.eclipse.jdt.core.javanature - com.google.gwt.eclipse.core.gwtNature - com.google.gdt.eclipse.core.webAppNature - - diff --git a/gwt/.settings/com.google.appengine.eclipse.core.prefs b/gwt/.settings/com.google.appengine.eclipse.core.prefs deleted file mode 100644 index ae3532c..0000000 --- a/gwt/.settings/com.google.appengine.eclipse.core.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Sun Feb 19 15:55:37 CET 2012 -eclipse.preferences.version=1 -filesCopiedToWebInfLib= -googleCloudSqlEnabled=false -localDevMySqlEnabled=true -ormEnhancementInclusions=src/ diff --git a/gwt/.settings/com.google.gdt.eclipse.core.prefs b/gwt/.settings/com.google.gdt.eclipse.core.prefs deleted file mode 100644 index b545612..0000000 --- a/gwt/.settings/com.google.gdt.eclipse.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Sun May 02 15:40:32 CEST 2010 -eclipse.preferences.version=1 -jarsExcludedFromWebInfLib=C\:/eclipse/gwt_maps/gwt-maps.jar|C\:/eclipse/gwt_incubator/gwt-incubator-july-14-2009.jar diff --git a/gwt/.settings/com.google.gwt.eclipse.core.prefs b/gwt/.settings/com.google.gwt.eclipse.core.prefs deleted file mode 100644 index 6676d5c..0000000 --- a/gwt/.settings/com.google.gwt.eclipse.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Sun May 02 16:09:45 CEST 2010 -eclipse.preferences.version=1 -entryPointModules= -filesCopiedToWebInfLib=gwt-servlet.jar -gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+UFJFVFRZPC9vdXRwdXQtc3R5bGU+PGV4dHJhLWFyZ3M+PCFbQ0RBVEFbXV0+PC9leHRyYS1hcmdzPjx2bS1hcmdzPjwhW0NEQVRBWy1YbXg1MTJtXV0+PC92bS1hcmdzPjwvZ3d0LWNvbXBpbGUtc2V0dGluZ3M+ diff --git a/gwt/gwt-unitCache/gwt-unitCache-00000137FB509AA8 b/gwt/gwt-unitCache/gwt-unitCache-00000137FB509AA8 deleted file mode 100644 index 63de915..0000000 Binary files a/gwt/gwt-unitCache/gwt-unitCache-00000137FB509AA8 and /dev/null differ diff --git a/gwt/input/inputForDistanceMatrixComputation.in b/gwt/input/inputForDistanceMatrixComputation.in deleted file mode 100644 index ef32815..0000000 --- a/gwt/input/inputForDistanceMatrixComputation.in +++ /dev/null @@ -1,7 +0,0 @@ -Rennes, France: 13 -Paris, France: 14 -Nantes, France: 15 -Rouen, France : 14 -La Rochelle, France: 18 -Orleans, France: 22 -Bourges, France: 20 \ No newline at end of file diff --git a/gwt/libs/gwt-maps-1.1.1/gwt-maps.jar b/gwt/libs/gwt-maps-1.1.1/gwt-maps.jar deleted file mode 100644 index 6dcd30d..0000000 Binary files a/gwt/libs/gwt-maps-1.1.1/gwt-maps.jar and /dev/null differ diff --git a/gwt/libs/gwt-maps3-0.2b.jar b/gwt/libs/gwt-maps3-0.2b.jar deleted file mode 100644 index cd659f1..0000000 Binary files a/gwt/libs/gwt-maps3-0.2b.jar and /dev/null differ diff --git a/gwt/src/META-INF/jdoconfig.xml b/gwt/src/META-INF/jdoconfig.xml deleted file mode 100644 index 5f56aa1..0000000 --- a/gwt/src/META-INF/jdoconfig.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/gwt/src/log4j.properties b/gwt/src/log4j.properties deleted file mode 100644 index d9c3edc..0000000 --- a/gwt/src/log4j.properties +++ /dev/null @@ -1,24 +0,0 @@ -# A default log4j configuration for log4j users. -# -# To use this configuration, deploy it into your application's WEB-INF/classes -# directory. You are also encouraged to edit it as you like. - -# Configure the console as our one appender -log4j.appender.A1=org.apache.log4j.ConsoleAppender -log4j.appender.A1.layout=org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n - -# tighten logging on the DataNucleus Categories -log4j.category.DataNucleus.JDO=WARN, A1 -log4j.category.DataNucleus.Persistence=WARN, A1 -log4j.category.DataNucleus.Cache=WARN, A1 -log4j.category.DataNucleus.MetaData=WARN, A1 -log4j.category.DataNucleus.General=WARN, A1 -log4j.category.DataNucleus.Utility=WARN, A1 -log4j.category.DataNucleus.Transaction=WARN, A1 -log4j.category.DataNucleus.Datastore=WARN, A1 -log4j.category.DataNucleus.ClassLoading=WARN, A1 -log4j.category.DataNucleus.Plugin=WARN, A1 -log4j.category.DataNucleus.ValueGeneration=WARN, A1 -log4j.category.DataNucleus.Enhancer=WARN, A1 -log4j.category.DataNucleus.SchemaTool=WARN, A1 diff --git a/gwt/src/vrp/VRPClient.gwt.xml b/gwt/src/vrp/VRPClient.gwt.xml deleted file mode 100644 index 31b248c..0000000 --- a/gwt/src/vrp/VRPClient.gwt.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/gwt/src/vrp/client/VRPGui.java b/gwt/src/vrp/client/VRPGui.java deleted file mode 100644 index 201e008..0000000 --- a/gwt/src/vrp/client/VRPGui.java +++ /dev/null @@ -1,651 +0,0 @@ -package vrp.client; - -import java.util.List; - -import com.google.gwt.core.client.EntryPoint; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.maps.client.MapWidget; -import com.google.gwt.maps.client.geocode.DirectionQueryOptions; -import com.google.gwt.maps.client.geocode.DirectionResults; -import com.google.gwt.maps.client.geocode.Directions; -import com.google.gwt.maps.client.geocode.DirectionsCallback; -import com.google.gwt.maps.client.geocode.Placemark; -import com.google.gwt.maps.client.geocode.Waypoint; -import com.google.gwt.maps.client.geom.LatLng; -import com.google.gwt.maps.client.overlay.PolyStyleOptions; -import com.google.gwt.user.client.ui.Grid; - - -import com.google.gwt.user.client.Timer; -import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.ui.Button; -import com.google.gwt.user.client.ui.DecoratedTabPanel; -import com.google.gwt.user.client.ui.DialogBox; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.user.client.ui.ListBox; -import com.google.gwt.user.client.ui.RootPanel; -import com.google.gwt.user.client.ui.TextArea; -import com.google.gwt.user.client.ui.TextBox; -import com.google.gwt.user.client.ui.VerticalPanel; -import com.google.gwt.canvas.client.Canvas; -import com.google.gwt.canvas.dom.client.Context2d; - - -import vrp.model.*; - -/** - * Entry point classes define onModuleLoad(). - */ -public class VRPGui implements EntryPoint { - - private MapWidget map; - private int[][] distances; - private int[] amounts; - private int iCoord,jCoord; - private int comDist; - private int count; - private TextArea output,input; - private String[] adds; - //current query sended to google maps - private String currentQuery = ""; - - private DialogBox exDialog; - private TextBox txtNodeCount, txtdistanceConst,txtAmountConst, txtCarLimit; - - private Button btnCompDistanceMatrix,btnVisCities,btnVisPoint,btnGenerateRand, btnSweep,btnClark; - - private ListBox lst; - - private int routeCount = 0; - - private HorizontalPanel myPanel; - private VerticalPanel topPanel; - private DecoratedTabPanel midlePanel,actionsPanel; - - - private String[] colors = {"red","blue","green","black","yellow","braun","gray"}; - private String[] colorStyles = {"red","green","blue","black","cyan","yellow","gray"}; - private int nCount; - private Node[] nodes; - private Canvas canvasMain; - private Context2d context; - - private String htmlExample = "4
0 355 1029 883
355 0 1052 1035
1029 1052 0 851
883 1035 851 0
" + - "
0;Prague;50.087811;14.42046
13;Berlin, Germany;52.523405;13.4114
25;Paris, France;48.856667;2.350987
" + - "15;Milano, Italy;45.463689;9.188141"; - - public void createExDialog(String errMessage){ - exDialog = new DialogBox(); - VerticalPanel pn1 = new VerticalPanel(); - - - String htmlString = "

Exception while parsing the points, the input has to be like this:

" + - htmlExample + - "

First line: number of nodes

" + - "

Distance matrix - the distance from each node to all others

" + - "

Each line representing a node: [Demand - in 'units' how many does the city want] [Adress] [X coordinate] [Y coordinate]

" + - "

Also you need to set the CAR LIMIT - how many 'units' can your car handle

"; - HTML htmlContent = new HTML(htmlString); - - - pn1.add(htmlContent); - pn1.add(new HTML("Details: " + errMessage + "")); - Button btnClose = new Button("Close", new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - exDialog.hide(); - } - - }); - - pn1.add(btnClose); - exDialog.add(pn1); - } - - /** - * The callback called when the directions were computed - */ - DirectionsCallback callBack = new DirectionsCallback(){ - public void onFailure(int statusCode) { - Window.alert("Problem with localization on MAP: " +statusCode + "\n Query: " + currentQuery); - } - - - public void onSuccess(DirectionResults result) { - double distMeters = result.getDistance().inMeters(); - - if(nodes[iCoord].x==0 || nodes[iCoord].y==0){ - List placeMarks = result.getPlacemarks(); - Placemark pm1 = placeMarks.get(0); - LatLng pm1Point = pm1.getPoint(); - - nodes[iCoord].x = pm1Point.getLatitude(); - nodes[iCoord].y = pm1Point.getLongitude(); - } - - comDist = (int)distMeters/1000; - distances[iCoord][jCoord] = comDist; - distances[jCoord][iCoord] = comDist; - - Timer t = new Timer(){ - - @Override - public void run() { - processNext(); - this.cancel(); - } - }; - t.schedule(500); - //processNext(); - } - }; - - DirectionsCallback visualiseCallBack = new DirectionsCallback(){ - - @Override - public void onFailure(int statusCode) { - Window.alert(""+statusCode); - } - - @Override - public void onSuccess(DirectionResults result) { - PolyStyleOptions style = PolyStyleOptions.getInstance(); - style.setColor(colors[routeCount%colors.length]); - result.getPolyline().setStrokeStyle(style); - routeCount++; - - - } - }; - - public void loadPoints(){ - //clear the points which are on canvas - - String in = input.getText(); - String[] inField = in.split("\n"); - - nCount = Integer.parseInt(inField[0]); - distances = new int[nCount][nCount]; - - //nactu tabulku vzdalenosti - for(int i=0;iError while generating random matrix, details:

"); - // Add a close button at the bottom of the dialog - Button closeButton = new Button("Close", - new ClickHandler() { - public void onClick(ClickEvent event) { - db.hide(); - } - }); - dialogContent.add(label); - dialogContent.add(closeButton); - dialogContent.add(new HTML("" + ex.toString() + "")); - db.add(dialogContent); - db.center(); - db.show(); - } - } - }; - ClickHandler visualiseTSPHandler = new ClickHandler(){ - - @Override - public void onClick(ClickEvent event) { - String text = output.getText(); - String[] input = text.split("\n"); - int routesCount = Integer.parseInt(input[0]); - - for(int i=routesCount+1;i<(2*routesCount+1);i++){ - String citiesString = input[i]; - final String[] cities = citiesString.split("->"); - - final Waypoint[] wPoints = new Waypoint[cities.length]; - - //projdu mesta a zobrazim je - for(int j=0;j","\n"); - - - - input.setText(noHTMLString); - - output = new TextArea(); - output.setHeight("150px"); - output.setWidth("500px"); - - lst = new ListBox(); - - - btnVisCities = new Button("Visualise on MAP"); - btnVisCities.addClickHandler(visualiseTSPHandler); - - - btnVisPoint = new Button("Visualise on GRAPH"); - btnVisPoint.addClickHandler(visualizePointsHandler); - - btnGenerateRand = new Button("Generate Random"); - btnGenerateRand.addClickHandler(generateRandHand); - - btnSweep = new Button("Sweep Alg."); - btnSweep.addClickHandler(sweepClickHandler); - - btnClark = new Button("Clark & Wright Alg."); - btnClark.addClickHandler(clarkClickHandler); - - Grid genGrid = new Grid(4,2); - - HTML htmlAmount = new HTML("Amount mult const:"); - txtAmountConst = new TextBox(); - txtAmountConst.setText("15"); - txtAmountConst.setFocus(true); - txtAmountConst.setWidth("40px"); - genGrid.setWidget(0, 0, htmlAmount); - genGrid.setWidget(0, 1, txtAmountConst); - - HTML htmlDistance = new HTML("Distance mult const:"); - txtdistanceConst = new TextBox(); - txtdistanceConst.setText("200"); - txtdistanceConst.selectAll(); - txtdistanceConst.setWidth("40px"); - - genGrid.setWidget(1,0, htmlDistance); - genGrid.setWidget(1,1, txtdistanceConst); - - HTML htmlNodeCount = new HTML("Node count:"); - txtNodeCount = new TextBox(); - txtNodeCount.setText("30"); - txtNodeCount.selectAll(); - txtNodeCount.setWidth("40px"); - genGrid.setWidget(2, 0, htmlNodeCount); - genGrid.setWidget(2, 1, txtNodeCount); - - - actionsPanel = new DecoratedTabPanel(); - - VerticalPanel generateVerticalPanel = new VerticalPanel(); - generateVerticalPanel.add(genGrid); - generateVerticalPanel.add(btnGenerateRand); - - - actionsPanel.add(generateVerticalPanel,"Generate random graph"); - - txtCarLimit = new TextBox(); - txtCarLimit.setText("40"); - - VerticalPanel vrpVerticalPanel = new VerticalPanel(); - vrpVerticalPanel.add(new HTML("The CAR LIMIT:")); - vrpVerticalPanel.add(txtCarLimit); - vrpVerticalPanel.add(btnSweep); - vrpVerticalPanel.add(btnClark); - vrpVerticalPanel.add(btnVisCities); - vrpVerticalPanel.add(btnVisPoint); - actionsPanel.add(vrpVerticalPanel,"Solve VRP"); - - VerticalPanel computeVerticalPanel = new VerticalPanel(); - - btnCompDistanceMatrix = new Button("Compute Distance Matrix"); - btnCompDistanceMatrix.addClickHandler(computeDistancesHandler); - computeVerticalPanel.add(btnCompDistanceMatrix); - computeVerticalPanel.add(lst); - actionsPanel.add(computeVerticalPanel,"Comp. Dist. Matrix"); - actionsPanel.selectTab(0); - - topPanel = new VerticalPanel(); - topPanel.add(actionsPanel); - topPanel.add(new HTML("INPUT:")); - topPanel.add(input); - topPanel.add(new HTML("OUTPUT:")); - topPanel.add(output); - - - midlePanel = new DecoratedTabPanel(); - midlePanel.setHeight("500px"); - midlePanel.setWidth("600px"); - midlePanel.setAnimationEnabled(true); - - - - map = new MapWidget(); - map.setHeight("500px"); - map.setWidth("600px"); - - VerticalPanel pn2 = new VerticalPanel(); - pn2.add(map); - - midlePanel.add(pn2,"Map"); - - - canvasMain = Canvas.createIfSupported(); - canvasMain.setWidth("300px"); - canvasMain.setHeight("300px"); - - context = canvasMain.getContext2d(); - context.setStrokeStyle("green"); - context.setLineWidth(1); - - VerticalPanel pn1 = new VerticalPanel(); - pn1.add(canvasMain); - - midlePanel.add(pn1,"Graph"); - midlePanel.selectTab(0); - - myPanel = new HorizontalPanel(); - myPanel.add(topPanel); - myPanel.add(midlePanel); - myPanel.setSpacing(3); - RootPanel.get("mapsTutorial").add(myPanel); - } - public void printOut(){ - //vypisu - StringBuilder sb = new StringBuilder(); - - sb.append(count); - for(int i=0;i - - - - - \ No newline at end of file diff --git a/gwt/src/vrp/model/Cluster.java b/gwt/src/vrp/model/Cluster.java deleted file mode 100644 index 578db94..0000000 --- a/gwt/src/vrp/model/Cluster.java +++ /dev/null @@ -1,106 +0,0 @@ -package vrp.model; - -import java.util.ArrayList; -import java.util.Collections; - -public class Cluster { - - int amount; - public ArrayList nodes; - public ArrayList edges; - public ArrayList tsp; - public ArrayList mstE; - - public int cost; - - public Cluster(){ - nodes = new ArrayList(); - edges = new ArrayList(); - } - - public void add(Node n){ - nodes.add(n); - amount+= n.amount; - } - - public Cluster copy(){ - Cluster n = new Cluster(); - n.amount = this.amount; - n.nodes = this.nodes; - return n; - } - - public void printMST(StringBuilder sb){ - System.out.println("CLUSTER:"); - for(Edge e:mstE){ - sb.append("From: " + e.n1.index + " To: " + e.n2.index + " Val: " + e.val); - } - } - - public void mst(){ - mstE = new ArrayList(); - - nodes.get(0).visited = true; - nodes.get(0).mstEdges = new ArrayList(); - int visitedNodes = 1; - Collections.sort(edges); - - while(visitedNodes!= nodes.size()){ - boolean added = false; - int counter = 0; - while(!added){ - - Edge e = edges.get(counter); - if((e.n1.visited == true && e.n2.visited == false)){ - //||(e.n2.visited == true && e.n1.visited == false)){ - mstE.add(e); - //e.n1.visited = true; - e.n2.visited = true; - //pridam do MST hran, ktere tvori kostru - if(e.n1.mstEdges == null){ - e.n1.mstEdges = new ArrayList(); - } - e.n1.mstEdges.add(e); - added = true; - visitedNodes++; - } - counter++; - } - } - } - - public void dfsONMST(){ - tsp = new ArrayList(); - Node start = nodes.get(0); - dfsProjdi(start); - tsp.add(start); - } - - public void dfsProjdi(Node n){ - tsp.add(n); - if(n.mstEdges!=null){ - for(Edge e:n.mstEdges){ - Node n2 = e.n2; - dfsProjdi(n2); - } - } - } - - public void printTSP(StringBuilder sb){ - //System.out.println("CLUSTER TSP:"); - for(Node n:tsp){ - sb.append(n.index + " "); - } - } - - public void printTSPAdds(StringBuilder sb) { - int nodeCount = tsp.size(); - for(int i=0;i"); - } - } - } -} diff --git a/gwt/src/vrp/model/Coord.java b/gwt/src/vrp/model/Coord.java deleted file mode 100644 index fda0241..0000000 --- a/gwt/src/vrp/model/Coord.java +++ /dev/null @@ -1,3 +0,0 @@ -package vrp.model; - - diff --git a/gwt/src/vrp/model/Edge.java b/gwt/src/vrp/model/Edge.java deleted file mode 100644 index bd60298..0000000 --- a/gwt/src/vrp/model/Edge.java +++ /dev/null @@ -1,36 +0,0 @@ -package vrp.model; - -public class Edge implements Comparable{ - public Node n1; - public Node n2; - - public int val; - - public Edge next; - - public Edge(Node ln1,Node ln2,int dist){ - this.n1 = ln1; - this.n2 = ln2; - this.val = dist; - } - - public void connect(Edge e1){ - next = e1; - } - - public void reverse(){ - Node swap = this.n2; - this.n2 = n1; - this.n1 = swap; - } - - @Override - public int compareTo(Edge o) { - if(this.val routes, StringBuilder sb){ - for(Route r:routes){ - printCities(r,sb); - sb.append("\r\n"); - } - } - - public static void printAdds(ArrayList routes,String[] adds,StringBuilder sb){ - int totalCost = 0; - for(Route r:routes){ - printAdds(r,adds,sb); - sb.append("\r\n"); - totalCost+= r.totalCost; - } - sb.append("TOTAL COST OF THE ROUTES: " + totalCost); - } - - public static void printRoute(Route r){ - System.out.print("Route: "); - Edge edge = r.outEdges[0]; - - System.out.print("(" + edge.n1.index + "->" + edge.n2.index + ")"); - - do{ - edge = r.outEdges[edge.n2.index]; - System.out.print("(" + edge.n1.index + "->" + edge.n2.index + ")"); - }while(edge.n2.index!=0); - - - System.out.print(" Amount: " + r.actual + " Cost: " + r.totalCost); - - System.out.println(""); - } - - /** - * Vytiskne mesta z jedne cesty - * @param r - */ - public static void printCities(Route r,StringBuilder sb){ - sb.append(0 + " "); - Edge edge = r.outEdges[0]; - sb.append(edge.n2.index + " "); - do{ - edge = r.outEdges[edge.n2.index]; - sb.append(edge.n2.index + " "); - }while(edge.n2.index!=0); - } - - /** - * Vytiskne adresy mest z jedne cesty - * @param r - * @param adds - */ - public static void printAdds(Route r,String[] adds,StringBuilder sb){ - sb.append(adds[0]); - Edge edge = r.outEdges[0]; - sb.append(" -> " + adds[edge.n2.index]); - do{ - edge = r.outEdges[edge.n2.index]; - sb.append(" -> " + adds[edge.n2.index]); - }while(edge.n2.index!=0); - } - - /** - * Vytiskne hrany ze vsech cest - * @param routes - */ - public static void printRoutes(ArrayList routes){ - int totalCost = 0; - for(Route r:routes){ - printRoute(r); - totalCost+= r.totalCost; - } - - System.out.println("Total cost of the routes: " + totalCost); - } - - public static int compClusterCost(Cluster cl,int distances[][]){ - int cost = 0; - for(int i=0;i{ - public int index; - public Route route; - - - public int cluster; - public double x; - public double y; - public double angle; - - public int state; - public boolean visited; - - public ArrayList mstEdges; - - public String add; - - public int amount; - - - public Node(int i){ - index = i; - } - - - @Override - public int compareTo(Node o) { - if(this.angle edges; - - public Route(int nodesNumber){ - edges = new ArrayList(); - - nodes = new int[nodesNumber]; - inEdges = new Edge[nodesNumber]; - outEdges = new Edge[nodesNumber]; - } - - public void add(Edge e){ - edges.add(e); - - outEdges[e.n1.index] = e; - inEdges[e.n2.index] = e; - - e.n1.route = this; - e.n2.route = this; - - totalCost+= e.val; - } - - public void removeEdgeToNode(int index){ - Edge e = inEdges[index]; - outEdges[e.n1.index] = null; - - totalCost-= e.val; - - edges.remove(e); - inEdges[index] = null; - } - - public void removeEdgeFromNode(int index){ - Edge e = outEdges[index]; - inEdges[e.n2.index] = null; - - totalCost-=e.val; - edges.remove(e); - outEdges[index] = null; - } - - public int predecesor(int nodeIndex){ - return inEdges[nodeIndex].n1.index; - } - - - public int sucessor(int nodeIndex){ - return outEdges[nodeIndex].n2.index; - } - - public boolean merge(Route r2,Edge mergingEdge){ - - int from = mergingEdge.n1.index; - int to = mergingEdge.n2.index; - - int predecesorI = this.predecesor(from); - int predecesorJ = r2.predecesor(to); - - int sucessorI = this.sucessor(from); - int sucessorJ = r2.sucessor(to); - - //moznost jedna - //hrana smeruje z uzlu ze, ktereho v prvni Route se vracime zpatky do uzlu 0 - //v druhe route je naopak predecesor uzlu J sklad = 0 - if(sucessorI == 0 && predecesorJ == 0){ - this.removeEdgeToNode(0); - r2.removeEdgeFromNode(0); - for(Edge e:r2.edges){ - this.add(e); - } - this.actual+= r2.actual; - this.add(mergingEdge); - return true; - // moznost dva - //hrana jde jakoby v protismeru - //uzel i je v prvni route druhy hned za skladem - //musime otocit hranu - }else if(sucessorJ == 0 && predecesorI == 0){ - mergingEdge.reverse(); - this.removeEdgeFromNode(0); - r2.removeEdgeToNode(0); - for(Edge e:r2.edges){ - this.add(e); - } - this.actual+= r2.actual; - this.add(mergingEdge); - return true; - } - - return false; - } -} diff --git a/gwt/src/vrp/model/Saving.java b/gwt/src/vrp/model/Saving.java deleted file mode 100644 index 24822f3..0000000 --- a/gwt/src/vrp/model/Saving.java +++ /dev/null @@ -1,26 +0,0 @@ -package vrp.model; - -public class Saving implements Comparable{ - public int val; - public Node from; - public Node to; - - public Saving(int v,Node f,Node t){ - val = v; - from = f; - to = t; - } - - @Override - public int compareTo(Saving o) { - - // TODO Auto-generated method stub - if(o.val routes; - private static int nCount; - private static int[] amounts; - - - public static ArrayList cluster(){ - Node depo = nodes[0]; - ArrayList nodesList = new ArrayList(); - - for(int i=1;i= depo.x){ - if(n.y>= depo.y){ - n.cluster = 1; - }else{ - n.cluster = 4; - } - }else{ - if(n.y>= depo.y){ - n.cluster = 2; - }else{ - n.cluster = 3; - } - } - - - for(int j=1;j<5;j++){ - if(n.cluster == j){ - double difx = Math.abs(n.x - depo.x); - double dify = Math.abs(n.y - depo.y); - - if(dify!=0){ - double tangA = (double)dify/difx; - - if(n.cluster == 2 || n.cluster == 4){ - tangA= 1/tangA; - } - n.angle+= Math.atan(tangA); - } - - break; - } - else{ - n.angle+= Math.PI/2; - } - } - nodesList.add(n); - } - return nodesList; - } - - /** - * Load the data from external variables - * @param lNodes - * @param lCount - * @param lDistances - * @param lAmounts - * @param lAdds - * @param carLim - * @return - */ - public static boolean loadData(Node[] lNodes,int lCount, int[][] lDistances, int[] lAmounts,String[] lAdds,int carLim){ - boolean returnVal = true; - - try{ - CAR_LIMIT = carLim; - nCount = lCount; - nodes = lNodes; - distances = lDistances; - amounts = lAmounts; - adds = lAdds; - }catch(Exception ex){ - returnVal = false; - } - - return returnVal; - } - - - /** - * Implementation of the Sweep algorithm - * @return - */ - public static String sweep(){ - ArrayList nodesList = cluster(); - Collections.sort(nodesList); - - //Cluster - Cluster actualCluster = new Cluster(); - - ArrayList clusters = new ArrayList(); - - //pridam 0 do clusteru - actualCluster.add(nodes[0]); - for(int i=0;i CAR_LIMIT){ - clusters.add(actualCluster); - actualCluster = new Cluster(); - //pridam depot uzel do kazdeho clusteru - actualCluster.add(nodes[0]); - } - - //pridam uzel do clusteru - //pridam vsechny hrany ktere inciduji s uzly ktere jiz jsou v clusteru - actualCluster.add(n); - for(int j=0;j(); - - //I create N nodes. Each node will be inserted into a route. - //each route will contain 2 edges - from the depo to the edge and back - for(int i=0;i sList = computeSaving(distances, nCount, savings,nodes); - //sorting the savings - Collections.sort(sList); - - //and use the savings until the list is not empty - while(!sList.isEmpty()){ - Saving actualS = sList.get(0); - - Node n1 = actualS.from; - Node n2 = actualS.to; - - Route r1 = n1.route; - Route r2 = n2.route; - - int from = n1.index; - int to = n2.index; - - //MyUtils.printSaving(actualS); - - if(actualS.val>0 && r1.actual+r2.actual computeSaving(int[][] dist,int n,int[][] sav,Node[] nodesField){ - sav = new int[n][n]; - ArrayList sList = new ArrayList(); - for(int i=1;i - - - 1 - - - - - - - \ No newline at end of file diff --git a/gwt/war/WEB-INF/classes/META-INF/jdoconfig.xml b/gwt/war/WEB-INF/classes/META-INF/jdoconfig.xml deleted file mode 100644 index 5f56aa1..0000000 --- a/gwt/war/WEB-INF/classes/META-INF/jdoconfig.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/gwt/war/WEB-INF/classes/log4j.properties b/gwt/war/WEB-INF/classes/log4j.properties deleted file mode 100644 index d9c3edc..0000000 --- a/gwt/war/WEB-INF/classes/log4j.properties +++ /dev/null @@ -1,24 +0,0 @@ -# A default log4j configuration for log4j users. -# -# To use this configuration, deploy it into your application's WEB-INF/classes -# directory. You are also encouraged to edit it as you like. - -# Configure the console as our one appender -log4j.appender.A1=org.apache.log4j.ConsoleAppender -log4j.appender.A1.layout=org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n - -# tighten logging on the DataNucleus Categories -log4j.category.DataNucleus.JDO=WARN, A1 -log4j.category.DataNucleus.Persistence=WARN, A1 -log4j.category.DataNucleus.Cache=WARN, A1 -log4j.category.DataNucleus.MetaData=WARN, A1 -log4j.category.DataNucleus.General=WARN, A1 -log4j.category.DataNucleus.Utility=WARN, A1 -log4j.category.DataNucleus.Transaction=WARN, A1 -log4j.category.DataNucleus.Datastore=WARN, A1 -log4j.category.DataNucleus.ClassLoading=WARN, A1 -log4j.category.DataNucleus.Plugin=WARN, A1 -log4j.category.DataNucleus.ValueGeneration=WARN, A1 -log4j.category.DataNucleus.Enhancer=WARN, A1 -log4j.category.DataNucleus.SchemaTool=WARN, A1 diff --git a/gwt/war/WEB-INF/classes/vrp/VRPClient.gwt.xml b/gwt/war/WEB-INF/classes/vrp/VRPClient.gwt.xml deleted file mode 100644 index 31b248c..0000000 --- a/gwt/war/WEB-INF/classes/vrp/VRPClient.gwt.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$1$1.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$1$1.class deleted file mode 100644 index be6ee56..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$1$1.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$1.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$1.class deleted file mode 100644 index 9543fd7..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$1.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$2.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$2.class deleted file mode 100644 index 5f8c697..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$2.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$3.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$3.class deleted file mode 100644 index 6594f9b..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$3.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$4$1.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$4$1.class deleted file mode 100644 index 0cc0f0c..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$4$1.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$4.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$4.class deleted file mode 100644 index cc12c19..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$4.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$5$1.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$5$1.class deleted file mode 100644 index f955e1b..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$5$1.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$5.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$5.class deleted file mode 100644 index 4ba83ed..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$5.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$6.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$6.class deleted file mode 100644 index 626d457..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$6.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$7.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$7.class deleted file mode 100644 index ad89dd1..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$7.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$8.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$8.class deleted file mode 100644 index f4f6edc..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$8.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$9.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui$9.class deleted file mode 100644 index 1a2b380..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui$9.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/client/VRPGui.class b/gwt/war/WEB-INF/classes/vrp/client/VRPGui.class deleted file mode 100644 index 75974fd..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/client/VRPGui.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model.gwt.xml b/gwt/war/WEB-INF/classes/vrp/model.gwt.xml deleted file mode 100644 index e49487e..0000000 --- a/gwt/war/WEB-INF/classes/vrp/model.gwt.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/gwt/war/WEB-INF/classes/vrp/model/Cluster.class b/gwt/war/WEB-INF/classes/vrp/model/Cluster.class deleted file mode 100644 index 17fa916..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/Cluster.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model/Edge.class b/gwt/war/WEB-INF/classes/vrp/model/Edge.class deleted file mode 100644 index 10bfbfe..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/Edge.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model/MyUtils.class b/gwt/war/WEB-INF/classes/vrp/model/MyUtils.class deleted file mode 100644 index 19cba71..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/MyUtils.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model/Node.class b/gwt/war/WEB-INF/classes/vrp/model/Node.class deleted file mode 100644 index 273a670..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/Node.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model/Route.class b/gwt/war/WEB-INF/classes/vrp/model/Route.class deleted file mode 100644 index 7a09543..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/Route.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model/Saving.class b/gwt/war/WEB-INF/classes/vrp/model/Saving.class deleted file mode 100644 index 3c8464d..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/Saving.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model/Stopwatch.class b/gwt/war/WEB-INF/classes/vrp/model/Stopwatch.class deleted file mode 100644 index b01a906..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/Stopwatch.class and /dev/null differ diff --git a/gwt/war/WEB-INF/classes/vrp/model/VRPProgram.class b/gwt/war/WEB-INF/classes/vrp/model/VRPProgram.class deleted file mode 100644 index a735d24..0000000 Binary files a/gwt/war/WEB-INF/classes/vrp/model/VRPProgram.class and /dev/null differ diff --git a/gwt/war/WEB-INF/deploy/vrp.model/rpcPolicyManifest/manifest.txt b/gwt/war/WEB-INF/deploy/vrp.model/rpcPolicyManifest/manifest.txt deleted file mode 100644 index cae1553..0000000 --- a/gwt/war/WEB-INF/deploy/vrp.model/rpcPolicyManifest/manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Module vrp.model -# RPC service class, partial path of RPC policy file diff --git a/gwt/war/WEB-INF/deploy/vrpgui/rpcPolicyManifest/manifest.txt b/gwt/war/WEB-INF/deploy/vrpgui/rpcPolicyManifest/manifest.txt deleted file mode 100644 index 7117678..0000000 --- a/gwt/war/WEB-INF/deploy/vrpgui/rpcPolicyManifest/manifest.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Module vrpgui -# RPC service class, partial path of RPC policy file diff --git a/gwt/war/WEB-INF/lib/appengine-api-1.0-sdk-1.3.3.1.jar b/gwt/war/WEB-INF/lib/appengine-api-1.0-sdk-1.3.3.1.jar deleted file mode 100644 index fc626af..0000000 Binary files a/gwt/war/WEB-INF/lib/appengine-api-1.0-sdk-1.3.3.1.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/appengine-api-labs-1.3.3.1.jar b/gwt/war/WEB-INF/lib/appengine-api-labs-1.3.3.1.jar deleted file mode 100644 index 603d32d..0000000 Binary files a/gwt/war/WEB-INF/lib/appengine-api-labs-1.3.3.1.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/appengine-jsr107cache-1.3.3.1.jar b/gwt/war/WEB-INF/lib/appengine-jsr107cache-1.3.3.1.jar deleted file mode 100644 index cafee8b..0000000 Binary files a/gwt/war/WEB-INF/lib/appengine-jsr107cache-1.3.3.1.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/datanucleus-appengine-1.0.6.final.jar b/gwt/war/WEB-INF/lib/datanucleus-appengine-1.0.6.final.jar deleted file mode 100644 index 8aa72d9..0000000 Binary files a/gwt/war/WEB-INF/lib/datanucleus-appengine-1.0.6.final.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/datanucleus-core-1.1.5.jar b/gwt/war/WEB-INF/lib/datanucleus-core-1.1.5.jar deleted file mode 100644 index c450ab9..0000000 Binary files a/gwt/war/WEB-INF/lib/datanucleus-core-1.1.5.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar b/gwt/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar deleted file mode 100644 index c326e0b..0000000 Binary files a/gwt/war/WEB-INF/lib/datanucleus-jpa-1.1.5.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar b/gwt/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar deleted file mode 100644 index 12d4ab0..0000000 Binary files a/gwt/war/WEB-INF/lib/geronimo-jpa_3.0_spec-1.1.1.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar b/gwt/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar deleted file mode 100644 index ee9963d..0000000 Binary files a/gwt/war/WEB-INF/lib/geronimo-jta_1.1_spec-1.1.1.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/gwt-servlet.jar b/gwt/war/WEB-INF/lib/gwt-servlet.jar deleted file mode 100644 index b3c62e4..0000000 Binary files a/gwt/war/WEB-INF/lib/gwt-servlet.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/jdo2-api-2.3-eb.jar b/gwt/war/WEB-INF/lib/jdo2-api-2.3-eb.jar deleted file mode 100644 index 2547a0b..0000000 Binary files a/gwt/war/WEB-INF/lib/jdo2-api-2.3-eb.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/lib/jsr107cache-1.1.jar b/gwt/war/WEB-INF/lib/jsr107cache-1.1.jar deleted file mode 100644 index a94aa31..0000000 Binary files a/gwt/war/WEB-INF/lib/jsr107cache-1.1.jar and /dev/null differ diff --git a/gwt/war/WEB-INF/logging.properties b/gwt/war/WEB-INF/logging.properties deleted file mode 100644 index 4a78b7f..0000000 --- a/gwt/war/WEB-INF/logging.properties +++ /dev/null @@ -1,28 +0,0 @@ -# A default java.util.logging configuration. -# (All App Engine logging is through java.util.logging by default). -# -# To use this configuration, copy it into your application's WEB-INF -# folder and add the following to your appengine-web.xml: -# -# -# -# -# - -# Set the default logging level for all loggers to WARNING -.level = WARNING - -# Set the default logging level for ORM, specifically, to WARNING -DataNucleus.JDO.level=WARNING -DataNucleus.Persistence.level=WARNING -DataNucleus.Cache.level=WARNING -DataNucleus.MetaData.level=WARNING -DataNucleus.General.level=WARNING -DataNucleus.Utility.level=WARNING -DataNucleus.Transaction.level=WARNING -DataNucleus.Datastore.level=WARNING -DataNucleus.ClassLoading.level=WARNING -DataNucleus.Plugin.level=WARNING -DataNucleus.ValueGeneration.level=WARNING -DataNucleus.Enhancer.level=WARNING -DataNucleus.SchemaTool.level=WARNING diff --git a/gwt/war/WEB-INF/web.xml b/gwt/war/WEB-INF/web.xml deleted file mode 100644 index d6194ee..0000000 --- a/gwt/war/WEB-INF/web.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - VRPGui.html - - - diff --git a/gwt/war/vrpgui/gwt/standard/images/ie6/corner_dialog_topright.png b/gwt/war/vrpgui/gwt/standard/images/ie6/corner_dialog_topright.png deleted file mode 100644 index a786ccc..0000000 Binary files a/gwt/war/vrpgui/gwt/standard/images/ie6/corner_dialog_topright.png and /dev/null differ diff --git a/gwt/war/vrpgui/gwt/standard/images/ie6/hborder_blue_shadow.png b/gwt/war/vrpgui/gwt/standard/images/ie6/hborder_blue_shadow.png deleted file mode 100644 index 7b52b8e..0000000 Binary files a/gwt/war/vrpgui/gwt/standard/images/ie6/hborder_blue_shadow.png and /dev/null differ diff --git a/gwt/war/vrpgui/gwt/standard/images/ie6/hborder_gray_shadow.png b/gwt/war/vrpgui/gwt/standard/images/ie6/hborder_gray_shadow.png deleted file mode 100644 index f4d1844..0000000 Binary files a/gwt/war/vrpgui/gwt/standard/images/ie6/hborder_gray_shadow.png and /dev/null differ diff --git a/gwt/war/vrpgui/gwt/standard/images/ie6/vborder_blue_shadow.png b/gwt/war/vrpgui/gwt/standard/images/ie6/vborder_blue_shadow.png deleted file mode 100644 index 6dcb44a..0000000 Binary files a/gwt/war/vrpgui/gwt/standard/images/ie6/vborder_blue_shadow.png and /dev/null differ diff --git a/gwt/war/vrpgui/gwt/standard/images/ie6/vborder_gray_shadow.png b/gwt/war/vrpgui/gwt/standard/images/ie6/vborder_gray_shadow.png deleted file mode 100644 index fccce49..0000000 Binary files a/gwt/war/vrpgui/gwt/standard/images/ie6/vborder_gray_shadow.png and /dev/null differ diff --git a/gwt/war/vrpgui/vrpgui.nocache.js b/gwt/war/vrpgui/vrpgui.nocache.js deleted file mode 100644 index 92d4075..0000000 --- a/gwt/war/vrpgui/vrpgui.nocache.js +++ /dev/null @@ -1,16 +0,0 @@ -function vrpgui(){var N='',ub='" for "gwt:onLoadErrorFn"',sb='" for "gwt:onPropertyErrorFn"',gb='"><\/script>',X='#',Sb='.cache.html',Z='/',Rb=':',mb='::',$b=' + + + \ No newline at end of file diff --git a/java/.classpath b/java/.classpath deleted file mode 100644 index fb50116..0000000 --- a/java/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/java/.project b/java/.project deleted file mode 100644 index f4b4646..0000000 --- a/java/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - VRPJava - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/java/.settings/org.eclipse.jdt.core.prefs b/java/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 2c734a9..0000000 --- a/java/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Sun Jun 17 11:33:27 CEST 2012 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/java/bin/vrp/model/Cluster.class b/java/bin/vrp/model/Cluster.class deleted file mode 100644 index 109662d..0000000 Binary files a/java/bin/vrp/model/Cluster.class and /dev/null differ diff --git a/java/bin/vrp/model/Edge.class b/java/bin/vrp/model/Edge.class deleted file mode 100644 index 10bfbfe..0000000 Binary files a/java/bin/vrp/model/Edge.class and /dev/null differ diff --git a/java/bin/vrp/model/Node.class b/java/bin/vrp/model/Node.class deleted file mode 100644 index 273a670..0000000 Binary files a/java/bin/vrp/model/Node.class and /dev/null differ diff --git a/java/bin/vrp/model/Route.class b/java/bin/vrp/model/Route.class deleted file mode 100644 index fe5d3aa..0000000 Binary files a/java/bin/vrp/model/Route.class and /dev/null differ diff --git a/java/bin/vrp/model/Saving.class b/java/bin/vrp/model/Saving.class deleted file mode 100644 index e4dac7d..0000000 Binary files a/java/bin/vrp/model/Saving.class and /dev/null differ diff --git a/java/bin/vrp/program/MyUtils.class b/java/bin/vrp/program/MyUtils.class deleted file mode 100644 index f2dc23a..0000000 Binary files a/java/bin/vrp/program/MyUtils.class and /dev/null differ diff --git a/java/bin/vrp/program/Start.class b/java/bin/vrp/program/Start.class deleted file mode 100644 index d27c48d..0000000 Binary files a/java/bin/vrp/program/Start.class and /dev/null differ diff --git a/java/bin/vrp/program/Stopwatch.class b/java/bin/vrp/program/Stopwatch.class deleted file mode 100644 index 0c1f8c8..0000000 Binary files a/java/bin/vrp/program/Stopwatch.class and /dev/null differ diff --git a/java/bin/vrp/program/VRPProgram.class b/java/bin/vrp/program/VRPProgram.class deleted file mode 100644 index d81667d..0000000 Binary files a/java/bin/vrp/program/VRPProgram.class and /dev/null differ diff --git a/java/input/inputTest1.in b/java/input/inputTest1.in deleted file mode 100644 index 62d3112..0000000 --- a/java/input/inputTest1.in +++ /dev/null @@ -1,10 +0,0 @@ -4 -0 355 1029 883 -355 0 1052 1035 -1029 1052 0 851 -883 1035 851 0 - -0;Prague;50.087811;14.42046 -13;Berlin, Germany;52.523405;13.4114 -25;Paris, France;48.856667;2.350987 -15;Milano, Italy;45.463689;9.188141 \ No newline at end of file diff --git a/java/input/inputTest2.in b/java/input/inputTest2.in deleted file mode 100644 index 3b109da..0000000 --- a/java/input/inputTest2.in +++ /dev/null @@ -1,16 +0,0 @@ -7 -0 348 104 189 262 346 411 -348 0 384 227 476 136 247 -104 384 0 295 149 332 356 -189 227 295 0 437 352 417 -262 476 149 437 0 348 376 -346 136 332 352 348 0 122 -411 247 356 417 376 122 0 - -13;Rennes, France;48.111386;-1.681333 -14;Paris, France;48.863723;2.361235 -15;Nantes, France;47.236368;-1.566631 -14;Rouen, France ;49.172259;-0.282291 -18;La Rochelle, France;46.158054;-1.153905 -22;Orleans, France;47.89808;1.91114 -20;Bourges, France;47.077297;2.3956 \ No newline at end of file diff --git a/java/src/vrp/model/Cluster.java b/java/src/vrp/model/Cluster.java deleted file mode 100644 index c931ebd..0000000 --- a/java/src/vrp/model/Cluster.java +++ /dev/null @@ -1,106 +0,0 @@ -package vrp.model; - -import java.util.ArrayList; -import java.util.Collections; - -public class Cluster { - - public int amount; - public ArrayList nodes; - public ArrayList edges; - public ArrayList tsp; - public ArrayList mstE; - - public int cost; - - public Cluster(){ - nodes = new ArrayList(); - edges = new ArrayList(); - } - - public void add(Node n){ - nodes.add(n); - amount+= n.amount; - } - - public Cluster copy(){ - Cluster n = new Cluster(); - n.amount = this.amount; - n.nodes = this.nodes; - return n; - } - - public void printMST(StringBuilder sb){ - System.out.println("CLUSTER:"); - for(Edge e:mstE){ - sb.append("From: " + e.n1.index + " To: " + e.n2.index + " Val: " + e.val); - } - } - - public void mst(){ - mstE = new ArrayList(); - - nodes.get(0).visited = true; - nodes.get(0).mstEdges = new ArrayList(); - int visitedNodes = 1; - Collections.sort(edges); - - while(visitedNodes!= nodes.size()){ - boolean added = false; - int counter = 0; - while(!added){ - - Edge e = edges.get(counter); - if((e.n1.visited == true && e.n2.visited == false)){ - //||(e.n2.visited == true && e.n1.visited == false)){ - mstE.add(e); - //e.n1.visited = true; - e.n2.visited = true; - //pridam do MST hran, ktere tvori kostru - if(e.n1.mstEdges == null){ - e.n1.mstEdges = new ArrayList(); - } - e.n1.mstEdges.add(e); - added = true; - visitedNodes++; - } - counter++; - } - } - } - - public void dfsONMST(){ - tsp = new ArrayList(); - Node start = nodes.get(0); - dfsProjdi(start); - tsp.add(start); - } - - public void dfsProjdi(Node n){ - tsp.add(n); - if(n.mstEdges!=null){ - for(Edge e:n.mstEdges){ - Node n2 = e.n2; - dfsProjdi(n2); - } - } - } - - public void printTSP(StringBuilder sb){ - //System.out.println("CLUSTER TSP:"); - for(Node n:tsp){ - sb.append(n.index + " "); - } - } - - public void printTSPAdds(StringBuilder sb) { - int nodeCount = tsp.size(); - for(int i=0;i"); - } - } - } -} diff --git a/java/src/vrp/model/Edge.java b/java/src/vrp/model/Edge.java deleted file mode 100644 index bd60298..0000000 --- a/java/src/vrp/model/Edge.java +++ /dev/null @@ -1,36 +0,0 @@ -package vrp.model; - -public class Edge implements Comparable{ - public Node n1; - public Node n2; - - public int val; - - public Edge next; - - public Edge(Node ln1,Node ln2,int dist){ - this.n1 = ln1; - this.n2 = ln2; - this.val = dist; - } - - public void connect(Edge e1){ - next = e1; - } - - public void reverse(){ - Node swap = this.n2; - this.n2 = n1; - this.n1 = swap; - } - - @Override - public int compareTo(Edge o) { - if(this.val{ - public int index; - public Route route; - - - public int cluster; - public double x; - public double y; - public double angle; - - public int state; - public boolean visited; - - public ArrayList mstEdges; - - public String add; - - public int amount; - - - public Node(int i){ - index = i; - } - - - @Override - public int compareTo(Node o) { - if(this.angle edges; - - public Route(int nodesNumber){ - edges = new ArrayList(); - - nodes = new int[nodesNumber]; - inEdges = new Edge[nodesNumber]; - outEdges = new Edge[nodesNumber]; - } - - public void add(Edge e){ - edges.add(e); - - outEdges[e.n1.index] = e; - inEdges[e.n2.index] = e; - - e.n1.route = this; - e.n2.route = this; - - totalCost+= e.val; - } - - public void removeEdgeToNode(int index){ - Edge e = inEdges[index]; - outEdges[e.n1.index] = null; - - totalCost-= e.val; - - edges.remove(e); - inEdges[index] = null; - } - - public void removeEdgeFromNode(int index){ - Edge e = outEdges[index]; - inEdges[e.n2.index] = null; - - totalCost-=e.val; - edges.remove(e); - outEdges[index] = null; - } - - public int predecessor(int nodeIndex){ - return inEdges[nodeIndex].n1.index; - } - - - public int successor(int nodeIndex){ - return outEdges[nodeIndex].n2.index; - } - - public boolean merge(Route r2,Edge mergingEdge){ - - int from = mergingEdge.n1.index; - int to = mergingEdge.n2.index; - - int predecessorI = this.predecessor(from); - int predecessorJ = r2.predecessor(to); - - int successorI = this.successor(from); - int successorJ = r2.successor(to); - - //moznost jedna - //hrana smeruje z uzlu ze, ktereho v prvni Route se vracime zpatky do uzlu 0 - //v druhe route je naopak predecessor uzlu J sklad = 0 - if(successorI == 0 && predecessorJ == 0){ - this.removeEdgeToNode(0); - r2.removeEdgeFromNode(0); - for(Edge e:r2.edges){ - this.add(e); - } - this.actual+= r2.actual; - this.add(mergingEdge); - return true; - // moznost dva - //hrana jde jakoby v protismeru - //uzel i je v prvni route druhy hned za skladem - //musime otocit hranu - }else if(successorJ == 0 && predecessorI == 0){ - mergingEdge.reverse(); - this.removeEdgeFromNode(0); - r2.removeEdgeToNode(0); - for(Edge e:r2.edges){ - this.add(e); - } - this.actual+= r2.actual; - this.add(mergingEdge); - return true; - } - - return false; - } -} diff --git a/java/src/vrp/model/Saving.java b/java/src/vrp/model/Saving.java deleted file mode 100644 index aa64989..0000000 --- a/java/src/vrp/model/Saving.java +++ /dev/null @@ -1,24 +0,0 @@ -package vrp.model; - -public class Saving implements Comparable{ - public int val; - public Node from; - public Node to; - - public Saving(int v,Node f,Node t){ - val = v; - from = f; - to = t; - } - - @Override - public int compareTo(Saving o) { - if(o.val routes, StringBuilder sb){ - for(Route r:routes){ - printCities(r,sb); - sb.append("\r\n"); - } - } - - public static void printAdds(ArrayList routes,String[] adds,StringBuilder sb){ - int totalCost = 0; - for(Route r:routes){ - printAdds(r,adds,sb); - sb.append("\r\n"); - totalCost+= r.totalCost; - } - sb.append("TOTAL COST OF THE ROUTES: " + totalCost); - } - - public static void printRoute(Route r){ - System.out.print("Route: "); - Edge edge = r.outEdges[0]; - - System.out.print("(" + edge.n1.index + "->" + edge.n2.index + ")"); - - do{ - edge = r.outEdges[edge.n2.index]; - System.out.print("(" + edge.n1.index + "->" + edge.n2.index + ")"); - }while(edge.n2.index!=0); - - - System.out.print(" Amount: " + r.actual + " Cost: " + r.totalCost); - - System.out.println(""); - } - - /** - * Vytiskne mesta z jedne cesty - * @param r - */ - public static void printCities(Route r,StringBuilder sb){ - sb.append(0 + " "); - Edge edge = r.outEdges[0]; - sb.append(edge.n2.index + " "); - do{ - edge = r.outEdges[edge.n2.index]; - sb.append(edge.n2.index + " "); - }while(edge.n2.index!=0); - } - - /** - * Vytiskne adresy mest z jedne cesty - * @param r - * @param adds - */ - public static void printAdds(Route r,String[] adds,StringBuilder sb){ - sb.append(adds[0]); - Edge edge = r.outEdges[0]; - sb.append(" -> " + adds[edge.n2.index]); - do{ - edge = r.outEdges[edge.n2.index]; - sb.append(" -> " + adds[edge.n2.index]); - }while(edge.n2.index!=0); - } - - /** - * Vytiskne hrany ze vsech cest - * @param routes - */ - public static void printRoutes(ArrayList routes){ - int totalCost = 0; - for(Route r:routes){ - printRoute(r); - totalCost+= r.totalCost; - } - - System.out.println("Total cost of the routes: " + totalCost); - } - - public static int compClusterCost(Cluster cl,int distances[][]){ - int cost = 0; - for(int i=0;i routes; - private static int nCount; - private static int[] amounts; - - - public static ArrayList cluster(){ - Node depo = nodes[0]; - ArrayList nodesList = new ArrayList(); - - for(int i=1;i= depo.x){ - if(n.y>= depo.y){ - n.cluster = 1; - }else{ - n.cluster = 4; - } - }else{ - if(n.y>= depo.y){ - n.cluster = 2; - }else{ - n.cluster = 3; - } - } - - - for(int j=1;j<5;j++){ - if(n.cluster == j){ - double difx = Math.abs(n.x - depo.x); - double dify = Math.abs(n.y - depo.y); - - if(dify!=0){ - double tangA = (double)dify/difx; - - if(n.cluster == 2 || n.cluster == 4){ - tangA= 1/tangA; - } - n.angle+= Math.atan(tangA); - } - - break; - } - else{ - n.angle+= Math.PI/2; - } - } - nodesList.add(n); - } - return nodesList; - } - - /** - * Load the data from external variables - * @param lNodes - * @param lCount - * @param lDistances - * @param lAmounts - * @param lAdds - * @param carLim - * @return - */ - public static boolean loadData(Node[] lNodes,int lCount, int[][] lDistances, int[] lAmounts,String[] lAdds,int carLim){ - boolean returnVal = true; - - try{ - CAR_LIMIT = carLim; - nCount = lCount; - nodes = lNodes; - distances = lDistances; - amounts = lAmounts; - adds = lAdds; - }catch(Exception ex){ - returnVal = false; - } - - return returnVal; - } - - /** - * Load the data from file specified in the parameter - * @param file - * @throws IOException - */ - public static void loadData(String file) throws IOException{ - //BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-16")); - BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file))); - nCount = Integer.parseInt(in.readLine()); - distances = new int[nCount][nCount]; - - //nactu tabulku vzdalenosti - for(int i=0;i nodesList = cluster(); - Collections.sort(nodesList); - - //Cluster - Cluster actualCluster = new Cluster(); - - ArrayList clusters = new ArrayList(); - - //pridam 0 do clusteru - actualCluster.add(nodes[0]); - for(int i=0;i CAR_LIMIT){ - clusters.add(actualCluster); - actualCluster = new Cluster(); - //pridam depot uzel do kazdeho clusteru - actualCluster.add(nodes[0]); - } - - //pridam uzel do clusteru - //pridam vsechny hrany ktere inciduji s uzly ktere jiz jsou v clusteru - actualCluster.add(n); - for(int j=0;j(); - - //I create N nodes. Each node will be inserted into a route. - //each route will contain 2 edges - from the depo to the edge and back - for(int i=0;i sList = computeSaving(distances, nCount, savings,nodes); - //sorting the savings - Collections.sort(sList); - - //and use the savings until the list is not empty - while(!sList.isEmpty()){ - Saving actualS = sList.get(0); - - Node n1 = actualS.from; - Node n2 = actualS.to; - - Route r1 = n1.route; - Route r2 = n2.route; - - int from = n1.index; - int to = n2.index; - - //MyUtils.printSaving(actualS); - - if(actualS.val>0 && r1.actual+r2.actual computeSaving(int[][] dist,int n,int[][] sav,Node[] nodesField){ - sav = new int[n][n]; - ArrayList sList = new ArrayList(); - for(int i=1;i` element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out the documentation at http://help.github.com/pages or contact support@github.com and we’ll help you sort it out.","name":"Vehical-routing-problem","google":""} \ No newline at end of file diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css new file mode 100644 index 0000000..c6a6452 --- /dev/null +++ b/stylesheets/pygment_trac.css @@ -0,0 +1,69 @@ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { font-weight: bold } /* Keyword */ +.highlight .o { font-weight: bold } /* Operator */ +.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ +.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { font-weight: bold } /* Keyword.Constant */ +.highlight .kd { font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #009999 } /* Literal.Number */ +.highlight .s { color: #d14 } /* Literal.String */ +.highlight .na { color: #008080 } /* Name.Attribute */ +.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ +.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .ni { color: #800080 } /* Name.Entity */ +.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ +.highlight .nn { color: #555555 } /* Name.Namespace */ +.highlight .nt { color: #000080 } /* Name.Tag */ +.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .ow { font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #009999 } /* Literal.Number.Float */ +.highlight .mh { color: #009999 } /* Literal.Number.Hex */ +.highlight .mi { color: #009999 } /* Literal.Number.Integer */ +.highlight .mo { color: #009999 } /* Literal.Number.Oct */ +.highlight .sb { color: #d14 } /* Literal.String.Backtick */ +.highlight .sc { color: #d14 } /* Literal.String.Char */ +.highlight .sd { color: #d14 } /* Literal.String.Doc */ +.highlight .s2 { color: #d14 } /* Literal.String.Double */ +.highlight .se { color: #d14 } /* Literal.String.Escape */ +.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ +.highlight .si { color: #d14 } /* Literal.String.Interpol */ +.highlight .sx { color: #d14 } /* Literal.String.Other */ +.highlight .sr { color: #009926 } /* Literal.String.Regex */ +.highlight .s1 { color: #d14 } /* Literal.String.Single */ +.highlight .ss { color: #990073 } /* Literal.String.Symbol */ +.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #008080 } /* Name.Variable.Class */ +.highlight .vg { color: #008080 } /* Name.Variable.Global */ +.highlight .vi { color: #008080 } /* Name.Variable.Instance */ +.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ + +.type-csharp .highlight .k { color: #0000FF } +.type-csharp .highlight .kt { color: #0000FF } +.type-csharp .highlight .nf { color: #000000; font-weight: normal } +.type-csharp .highlight .nc { color: #2B91AF } +.type-csharp .highlight .nn { color: #000000 } +.type-csharp .highlight .s { color: #A31515 } +.type-csharp .highlight .sc { color: #A31515 } diff --git a/stylesheets/styles.css b/stylesheets/styles.css new file mode 100644 index 0000000..dacf2e1 --- /dev/null +++ b/stylesheets/styles.css @@ -0,0 +1,255 @@ +@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700); + +body { + padding:50px; + font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; + color:#777; + font-weight:300; +} + +h1, h2, h3, h4, h5, h6 { + color:#222; + margin:0 0 20px; +} + +p, ul, ol, table, pre, dl { + margin:0 0 20px; +} + +h1, h2, h3 { + line-height:1.1; +} + +h1 { + font-size:28px; +} + +h2 { + color:#393939; +} + +h3, h4, h5, h6 { + color:#494949; +} + +a { + color:#39c; + font-weight:400; + text-decoration:none; +} + +a small { + font-size:11px; + color:#777; + margin-top:-0.6em; + display:block; +} + +.wrapper { + width:860px; + margin:0 auto; +} + +blockquote { + border-left:1px solid #e5e5e5; + margin:0; + padding:0 0 0 20px; + font-style:italic; +} + +code, pre { + font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal; + color:#333; + font-size:12px; +} + +pre { + padding:8px 15px; + background: #f8f8f8; + border-radius:5px; + border:1px solid #e5e5e5; + overflow-x: auto; +} + +table { + width:100%; + border-collapse:collapse; +} + +th, td { + text-align:left; + padding:5px 10px; + border-bottom:1px solid #e5e5e5; +} + +dt { + color:#444; + font-weight:700; +} + +th { + color:#444; +} + +img { + max-width:100%; +} + +header { + width:270px; + float:left; + position:fixed; +} + +header ul { + list-style:none; + height:40px; + + padding:0; + + background: #eee; + background: -moz-linear-gradient(top, #f8f8f8 0%, #dddddd 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#dddddd)); + background: -webkit-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: -o-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: -ms-linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + background: linear-gradient(top, #f8f8f8 0%,#dddddd 100%); + + border-radius:5px; + border:1px solid #d2d2d2; + box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0; + width:270px; +} + +header li { + width:89px; + float:left; + border-right:1px solid #d2d2d2; + height:40px; +} + +header ul a { + line-height:1; + font-size:11px; + color:#999; + display:block; + text-align:center; + padding-top:6px; + height:40px; +} + +strong { + color:#222; + font-weight:700; +} + +header ul li + li { + width:88px; + border-left:1px solid #fff; +} + +header ul li + li + li { + border-right:none; + width:89px; +} + +header ul a strong { + font-size:14px; + display:block; + color:#222; +} + +section { + width:500px; + float:right; + padding-bottom:50px; +} + +small { + font-size:11px; +} + +hr { + border:0; + background:#e5e5e5; + height:1px; + margin:0 0 20px; +} + +footer { + width:270px; + float:left; + position:fixed; + bottom:50px; +} + +@media print, screen and (max-width: 960px) { + + div.wrapper { + width:auto; + margin:0; + } + + header, section, footer { + float:none; + position:static; + width:auto; + } + + header { + padding-right:320px; + } + + section { + border:1px solid #e5e5e5; + border-width:1px 0; + padding:20px 0; + margin:0 0 20px; + } + + header a small { + display:inline; + } + + header ul { + position:absolute; + right:50px; + top:52px; + } +} + +@media print, screen and (max-width: 720px) { + body { + word-wrap:break-word; + } + + header { + padding:0; + } + + header ul, header p.view { + position:static; + } + + pre, code { + word-wrap:normal; + } +} + +@media print, screen and (max-width: 480px) { + body { + padding:15px; + } + + header ul { + display:none; + } +} + +@media print { + body { + padding:0.4in; + font-size:12pt; + color:#444; + } +} diff --git a/gwt/war/VRPGui.css b/vrp/VRPGui.css similarity index 100% rename from gwt/war/VRPGui.css rename to vrp/VRPGui.css diff --git a/vrp/VRPGui.zip b/vrp/VRPGui.zip new file mode 100644 index 0000000..5694c4c Binary files /dev/null and b/vrp/VRPGui.zip differ diff --git a/gwt/war/index.html b/vrp/index.html similarity index 66% rename from gwt/war/index.html rename to vrp/index.html index eb9fd6b..992404c 100644 --- a/gwt/war/index.html +++ b/vrp/index.html @@ -9,9 +9,7 @@ Vehicle Routing Problem - - - + @@ -21,7 +19,7 @@

Vehicle Routing Problem

  • Clark & Wright Savings Algorithm
  • The Sweep Algorithm
  • -

    Quick HowTo for this tool and the source code can be found on my blog.

    +

    Quick HowTo for this tool and the source code can be found on my blog.

    diff --git a/vrp/test.html b/vrp/test.html new file mode 100644 index 0000000..afd6b20 --- /dev/null +++ b/vrp/test.html @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    + + + +
    + + + +
    + +
    + + + +

    Vehicle Routing Problem

    + +

    This is a small utility which solves the Vehicle Routing Problem. This tool was written in JAVA with usage of GWT API. This tool implements two basic algorithms:

    + +
      + +
    • Clark & Wright Savings Algorithm
    • + +
    • The Sweep Algorithm
    • + +
    + +

    Quick HowTo for this tool and the source code can be found on my blog.

    + +
    + + + +
    + +
    + +
    + +
    + + + + + \ No newline at end of file diff --git a/vrp/vrp.aspx b/vrp/vrp.aspx new file mode 100644 index 0000000..f072600 --- /dev/null +++ b/vrp/vrp.aspx @@ -0,0 +1,24 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="vrp.aspx.cs" Inherits="_about" %> + + + + +

    Vehicle Routing Problem

    +

    This is a small utility which solves the Vehicle Routing Problem. This tool was written in JAVA with usage of GWT API. This tool implements two basic algorithms:

    +
      +
    • Clark & Wright Savings Algorithm
    • +
    • The Sweep Algorithm
    • +
    +

    Quick HowTo for this tool and the source code can be found on my blog.

    +
    +
    \ No newline at end of file diff --git a/vrp/vrp.aspx.cs b/vrp/vrp.aspx.cs new file mode 100644 index 0000000..37bca5b --- /dev/null +++ b/vrp/vrp.aspx.cs @@ -0,0 +1,20 @@ +#region Using + +using System; +using System.Globalization; +using System.Text.RegularExpressions; +using System.Web; +using System.Xml; +using System.Collections.Generic; +using BlogEngine.Core; +using System.Web.UI; + +#endregion + +public partial class _about : BlogEngine.Core.Web.Controls.BlogBasePage +{ + protected void Page_Load(object sender, EventArgs e) + { + } + +} diff --git a/gwt/war/vrp.model/clear.cache.gif b/vrp/vrp.model/clear.cache.gif similarity index 100% rename from gwt/war/vrp.model/clear.cache.gif rename to vrp/vrp.model/clear.cache.gif diff --git a/gwt/war/vrp.model/hosted.html b/vrp/vrp.model/hosted.html similarity index 83% rename from gwt/war/vrp.model/hosted.html rename to vrp/vrp.model/hosted.html index f6c5d82..e8983af 100644 --- a/gwt/war/vrp.model/hosted.html +++ b/vrp/vrp.model/hosted.html @@ -12,7 +12,7 @@ var moduleName = moduleFunc ? moduleFunc.moduleName : "unknown"; $stats({moduleName:moduleName,sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date()).getTime(),type:'moduleEvalStart'}); } -var $hostedHtmlVersion="2.1"; +var $hostedHtmlVersion="2.0"; var gwtOnLoad; var $hosted = "localhost:9997"; @@ -60,12 +60,6 @@ Object.prototype.hasOwnProperty = function(prop) { return prop != "__gwt_ObjectId" && hop.call(this, prop); }; - // do the same in our parent as well -- see issue 4486 - // NOTE: this will have to be changed when we support non-iframe-based DevMode - var hop2 = parent.Object.prototype.hasOwnProperty; - parent.Object.prototype.hasOwnProperty = function(prop) { - return prop != "__gwt_ObjectId" && hop2.call(this, prop); - }; } // wrapper to call JS methods, which we need both to be able to supply a @@ -157,30 +151,16 @@ } function __gwt_disconnected_impl() { - __gwt_displayGlassMessage('GWT Code Server Disconnected', - 'Most likely, you closed GWT Development Mode. Or, you might have lost ' - + 'network connectivity. To fix this, try restarting GWT Development Mode and ' - + '' - + 'REFRESH this page.'); -} - -// Keep track of z-index to allow layering of multiple glass messages -var __gwt_glassMessageZIndex = 2147483647; - -// Note this method is also used by ModuleSpace.java -function __gwt_displayGlassMessage(summary, details) { var topWin = window.top; var topDoc = topWin.document; var outer = topDoc.createElement("div"); // Do not insert whitespace or outer.firstChild will get a text node. outer.innerHTML = - '
    ' + - '
    ' + summary + '
    ' + - '
    ' + details + '
    ' + - '
    ' + - '
    ' + '
    ' + + '
    ' + + '
    GWT Code Server Disconnected
    ' + + '

    Most likely, you closed GWT development mode. Or you might have lost network connectivity. To fix this, try restarting GWT Development Mode and REFRESH this page.

    ' + + '
    ' ; topDoc.body.appendChild(outer); var glass = outer.firstChild; @@ -207,8 +187,6 @@ // Nasty CSS; onresize would be better but the outer window won't let us add a listener IE. glassStyle.setExpression("height", "document.documentElement.clientHeight"); } - - $doc.title = summary + " [" + $doc.title + "]"; } function findPluginObject() { @@ -295,22 +273,13 @@ if (errFn) { errFn(modName); } else { - __gwt_displayGlassMessage("Plugin failed to connect to Development Mode server at " + - simpleEscape($hosted), - "Follow the underlying troubleshooting instructions"); + alert("Plugin failed to connect to hosted mode server at " + $hosted); loadIframe("http://code.google.com/p/google-web-toolkit/wiki/TroubleshootingOOPHM"); } } } } -function simpleEscape(originalString) { - return originalString.replace("&","&") - .replace("<","<") - .replace(">",">") - .replace("\"","""); -} - window.onunload = function() { }; @@ -322,7 +291,7 @@ window.__gwt_module_id = 0; -This html file is for Development Mode support. +This html file is for hosted mode support. -This html file is for Development Mode support. +This html file is for hosted mode support.