Debian Codegraph @

SYMPHONY/Applications/VRP/src/Heuristics/heur_main.c

raw
1 /*===========================================================================*/
2 /* */
3 /* This file is part of a demonstration application for use with the */
4 /* SYMPHONY Branch, Cut, and Price Library. This application is a solver for */
5 /* the Vehicle Routing Problem and the Traveling Salesman Problem. */
6 /* */
7 /* This application was developed by Ted Ralphs ([email protected]) */
8 /* This file was written by Ali Pilatin January, 2005 ([email protected]) */
9 /* */
10 /* (c) Copyright 2000-2005 Lehigh University. All Rights Reserved. */
11 /* */
12 /* This software is licensed under the Eclipse Public License. Please see */
13 /* accompanying file for terms. */
14 /* */
15 /*===========================================================================*/
16
17 #include "vrp_heurs.h"
18 #include "heur_routines.h"
19 #include <stdio.h>
20
21 int main (int argc, char **argv)
22 {
23 int r_bufid, info, bytes, msgtag, parent, endofprocess = 0;
24 heur_prob *p = (heur_prob *) calloc(1, sizeof(heur_prob));
25 parent = receive(p);
26 printf("\nWelcome, I am task %i\n\n", pvm_mytid());
27 while(!endofprocess){
28 printf("\nim gonna try to receive at parallel_process.\n");
29 PVM_FUNC(r_bufid, pvm_recv(-1, -1));
30 PVM_FUNC(info, pvm_bufinfo(r_bufid, &bytes, &msgtag, &parent));
31 printf("\nim still in parallel_process\n");
32 switch(msgtag){
33
34 case S_EXCHANGE:
35 exchange(parent, p);
36 break;
37
38 case S_EXCHANGE2:
39 exchange2(parent, p);
40 break;
41
42 case S_FARNEAR_INS:
43 farnear_ins(parent, p);
44 break;
45
46 case S_FARTHEST_INS:
47 farthest_ins(parent, p);
48 break;
49
50 case S_MST:
51 mst();
52 break;
53
54 case S_NEAREST_INS:
55 nearest_ins(parent, p);
56 break;
57
58 case S_NEAR_CLUSTER:
59 near_cluster(parent, p);
60 break;
61
62 case S_SAVINGS:
63 savings(parent, p);
64 break;
65
66 case S_SAVINGS2:
67 savings2(parent, p);
68 break;
69
70 case S_SAVINGS3:
71 savings3(parent, p);
72 break;
73
74 case S_SWEEP:
75 sweep(parent, p);
76 break;
77
78 case S_TSP_FI:
79 tsp_fi(parent, p);
80 break;
81
82 case S_TSP_FINI:
83 tsp_fini(parent, p);
84 break;
85
86 case S_TSP_NI:
87 tsp_ni(parent, p);
88 break;
89
90 case STOP:
91 endofprocess = 1;
92
93 }
94 }
95 return 0;
96 }