用GA解VRP.docVIP

  • 5
  • 0
  • 约3.46万字
  • 约 33页
  • 2017-05-27 发布于江西
  • 举报
用GA解VRP

【程序的算法单元delphi写的】 unit uEA; interface uses uUtilsEA, uIEA, uITSP, Classes, GaPara, windows, SysUtils, fEA_TSP; type TIndividual = class(TInterfacedObject, IIndividual) private // The internally stored fitness value fFitness: TFloat; fWeConstrain: integer; fBackConstrain: integer; fTimeConstrain: integer; procedure SetFitness(const Value: TFloat); function GetFitness: TFloat; function GetWeConstrain: integer; procedure SetWeConstrain(const Value: integer); procedure SetBackConstrain(const Value: integer); function GetBackConstrain: integer; function GetTimeConstrain: integer; procedure SetTimeConstrain(const Value: integer); public property Fitness : TFloat read GetFitness write SetFitness; property WeConstrain :integer read GetWeConstrain write SetWeConstrain; property BackConstrain :integer read GetBackConstrain write SetBackConstrain; property TimeConstrain :integer read GetTimeConstrain write SetTimeConstrain; end; TTSPIndividual = class(TIndividual, ITSPIndividual) private // The route we travel fRouteArray : ArrayInt; fWeConstrain: integer; fBackConstrain: integer; fTimeConstrain: integer; function GetRouteArray(I: Integer): Integer; procedure SetRouteArray(I: Integer; const Value: Integer); procedure SetSteps(const Value: Integer); function GetSteps: Integer; function GetWeConstrain: integer; procedure SetWeConstrain(const Value: integer); procedure SetBackConstrain(const Value: integer); procedure SetTimeConstrain(const Value: integer); function GetBackConstrain: integer; function GetTimeConstrain: integer; public // Constructor, called with initial route size constructor Create(Size : TInt); reintroduce; destructor Destroy; override; property RouteArray[I : Integer] : Integer read GetRouteArray write SetRouteArray; // The number of steps on the route property Steps : Integer read GetSteps write SetSteps; property Fitness : TFloat read GetFitness write SetFitness; property WeConstrain :integer read GetWeConstrain write SetWeConstrain; property BackConstr

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档