public CLSCOBO_TruckItinerary(CLSCOBO_OriginPoint po_OriginPoint, List<CLSCOBO_DeliveryPoint> pl_DeliveryPoints)
 {
     ao_OriginPoint = po_OriginPoint;
     ao_DestinationPoints = new List<CLSCOBO_DeliveryPoint>();
     foreach(CLSCOBO_DeliveryPoint vo_DeliveryPoint in pl_DeliveryPoints){
         ao_DestinationPoints.Add(vo_DeliveryPoint);
     }
 }
        public static CLSCOBO_ConsolidationProblem ReadDemoData(ref string ps_FileName)
        {
            string vs_Line;
            string vs_FileName;
            string vs_State="";
            string vs_FirstZip="";
            string vs_SecondZip="";
            string vs_SelectedZip="";
            double vd_Weight=0;
            int vi_RandomPoint=-1;
            int vi_ChoosenAsOriginPoint=-1;
            int vi_RandomChoosenPoint=-1;
            int vi_RandomZipSelected=-1;

            TextReader vs_TextReader;
            List<CLSCOBO_DeliveryPoint> vl_DeliveryPoints=null;
            CLSCOBO_DeliveryPoint vo_TemporaryPoint;

            CLSCOBO_DeliveryPoint vo_DeliveryPoint;
            CLSCOBO_OriginPoint vo_OriginPoint;
            CLSCOBO_ConsolidationProblem vo_ConsolidationProblem;

            try {
                vs_FileName=System.AppDomain.CurrentDomain.BaseDirectory+cs_DEMO_DEFAULT_FILE;
                ps_FileName=cs_DEMO_DEFAULT_FILE;
                vs_TextReader=new StreamReader(vs_FileName);
                vl_DeliveryPoints=new List<CLSCOBO_DeliveryPoint>();
                while((vs_Line=vs_TextReader.ReadLine())!=null) {
                    vs_SelectedZip="";
                    vs_State=vs_Line.Substring(0, vs_Line.IndexOf(","));
                    vs_Line=vs_Line.Remove(0, vs_Line.IndexOf(",")+1);
                    vs_FirstZip=vs_Line.Substring(0, vs_Line.IndexOf(","));
                    vs_Line=vs_Line.Remove(0, vs_Line.IndexOf(",")+1);
                    vs_SecondZip=vs_Line.Substring(0, vs_Line.IndexOf(","));
                    vs_Line=vs_Line.Remove(0, vs_Line.IndexOf(",")+1);
                    vd_Weight=double.Parse(vs_Line.Remove(0, vs_Line.IndexOf(",")+1));
                    vi_RandomZipSelected=GenerateRandomNumber(1, 2);
                    vs_SelectedZip=(vi_RandomZipSelected==1)?(string.IsNullOrEmpty(vs_FirstZip)?vs_SecondZip:vs_FirstZip):(string.IsNullOrEmpty(vs_SecondZip)?vs_FirstZip:vs_SecondZip);
                    vs_SelectedZip=vs_State+" "+vs_SelectedZip;
                    vo_TemporaryPoint=new CLSCOBO_DeliveryPoint(vs_SelectedZip);
                    vo_TemporaryPoint.Weight=vd_Weight;
                    vl_DeliveryPoints.Add(vo_TemporaryPoint);
                }
                vs_TextReader.Close();
                vi_RandomPoint=GenerateRandomNumber(2, vl_DeliveryPoints.Count-1);
                vi_ChoosenAsOriginPoint=GenerateRandomNumber(0, vi_RandomPoint);
                vo_ConsolidationProblem=new CLSCOBO_ConsolidationProblem();
                vo_OriginPoint=new CLSCOBO_OriginPoint(vl_DeliveryPoints[vi_ChoosenAsOriginPoint].ZipCode);
                vo_ConsolidationProblem.OriginPoint=vo_OriginPoint;
                vl_DeliveryPoints.RemoveAt(vi_ChoosenAsOriginPoint);
                vi_RandomPoint--;
                for(int x=1;x<=vi_RandomPoint;x++) {
                    vi_RandomChoosenPoint=GenerateRandomNumber(0, vl_DeliveryPoints.Count-1);
                    vo_DeliveryPoint=vl_DeliveryPoints[vi_RandomChoosenPoint];
                    vo_ConsolidationProblem.AddDeliveryPoint(vo_DeliveryPoint);
                    vl_DeliveryPoints.RemoveAt(vi_RandomChoosenPoint);
                }
            } catch {
                vo_ConsolidationProblem=null;
            }
            return vo_ConsolidationProblem;
        }
        public static CLSCOBO_ConsolidationProblem ReadFile(ref String ps_FileName)
        {
            string vs_Line;
            string vi_OriginDestinationIndicator="";
            TextReader vs_TextReader;
            CLSCOBO_DeliveryPoint vo_DeliveryPoint;
            CLSCOBO_OriginPoint vo_OriginPoint;
            CLSCOBO_ConsolidationProblem vo_ConsolidationProblem;

            try {
                if(string.IsNullOrEmpty(ps_FileName)) {
                    vo_ConsolidationProblem=ReadDemoData(ref ps_FileName);
                } else {
                    vo_ConsolidationProblem=new CLSCOBO_ConsolidationProblem();
                    ps_FileName=System.AppDomain.CurrentDomain.BaseDirectory+(string.IsNullOrEmpty(ps_FileName)?cs_DEMO_DEFAULT_FILE:ps_FileName);
                    vs_TextReader=new StreamReader(ps_FileName);

                    while((vs_Line=vs_TextReader.ReadLine())!=null) {
                        vi_OriginDestinationIndicator=vs_Line.Substring(0, vs_Line.IndexOf(","));
                        vs_Line=vs_Line.Remove(0, vs_Line.IndexOf(",")+1);
                        if(vi_OriginDestinationIndicator.ToUpper()=="O") {
                            vo_OriginPoint=new CLSCOBO_OriginPoint(vs_Line.Substring(0, vs_Line.IndexOf(",")));
                            vo_ConsolidationProblem.OriginPoint=vo_OriginPoint;
                        } else {
                            vo_DeliveryPoint=new CLSCOBO_DeliveryPoint(vs_Line.Substring(0, vs_Line.IndexOf(",")));
                            vo_DeliveryPoint.Weight=double.Parse(vs_Line.Remove(0, vs_Line.IndexOf(",")+1));
                            vo_ConsolidationProblem.Deliveries.Add(vo_DeliveryPoint);
                        }
                    }
                    vs_TextReader.Close();
                }
            } catch {
                vo_ConsolidationProblem=null;
            }
            return vo_ConsolidationProblem;
        }
 public CLSCOBO_ConsolidationProblem()
 {
     ao_origin = new CLSCOBO_OriginPoint();
     ao_deliveries = new List<CLSCOBO_DeliveryPoint>();
 }