Skip to content

Commit

Permalink
Fix Clone Session + AutoBuild relays running (v1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artanemus committed Oct 3, 2024
1 parent b97c25c commit bbf3636
Show file tree
Hide file tree
Showing 8 changed files with 264 additions and 2,822 deletions.
103 changes: 50 additions & 53 deletions AUTOBUILD/dlgABRelay.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ object ABRelay: TABRelay
Align = alClient
BevelOuter = bvNone
TabOrder = 2
object lbl7: TLabel
object lblMemberMissingData: TLabel
Left = 22
Top = 130
Width = 238
Expand All @@ -183,24 +183,16 @@ object ABRelay: TABRelay
Font.Style = [fsUnderline]
ParentFont = False
end
object lbl8: TLabel
object lblPercent: TLabel
Left = 106
Top = 187
Width = 333
Height = 21
Caption = 'percent. (With consideration to age and gender.)'
end
object lblSeedDepth: TLabel
Left = 344
Top = 334
Width = 81
Height = 21
Caption = 'Seed depth:'
Enabled = False
end
object lblSwimmersPerTeam: TLabel
Left = 80
Top = 334
Top = 372
Width = 143
Height = 21
Caption = 'Swimmers per team.'
Expand Down Expand Up @@ -245,6 +237,39 @@ object ABRelay: TABRelay
OnClick = vimgHint3Click
OnMouseLeave = vimgHintMouseLeave
end
object lblAcceptableMargin: TLabel
Left = 229
Top = 283
Width = 230
Height = 21
Caption = 'Acceptable margin (default 20%)'
end
object vimgPackMethod: TVirtualImage
Left = 479
Top = 240
Width = 24
Height = 25
ImageCollection = imgcolABRelay
ImageWidth = 0
ImageHeight = 0
ImageIndex = 0
ImageName = 'Info'
OnClick = vimgPackMethodClick
OnMouseLeave = vimgHintMouseLeave
end
object rgrpAlgorithm: TRadioGroup
Left = 22
Top = 232
Width = 451
Height = 117
Caption = 'Pack Method.'
ItemIndex = 0
Items.Strings = (
'SCM Basic bin pack.'
'SCM Refined.'
'Generic Algorithm.')
TabOrder = 9
end
object prefHeatAlgorithm: TRadioGroup
Left = 22
Top = 6
Expand Down Expand Up @@ -296,49 +321,24 @@ object ABRelay: TABRelay
Enabled = False
TabOrder = 3
end
object rgpSeedMethod: TRadioGroup
Left = 253
Top = 230
Width = 225
Height = 95
Hint = 'Decides what lane an entrant is given.'
Caption = 'Seed Method.'
Enabled = False
ItemIndex = 0
Items.Strings = (
'SwimClubMeet (default)'
'Circle Seeding')
TabOrder = 5
end
object spnSeedDepth: TSpinEdit
Left = 431
Top = 331
Width = 48
Height = 31
Enabled = False
MaxValue = 10
MinValue = 0
TabOrder = 6
Value = 3
end
object prefDoHouseRelays: TCheckBox
Left = 253
Top = 406
Width = 155
Height = 25
Caption = 'Arrange by house.'
Enabled = False
TabOrder = 7
TabOrder = 5
end
object prefNumOfSwimmersPerTeam: TSpinEdit
Left = 22
Top = 331
Top = 369
Width = 52
Height = 31
Enabled = False
MaxValue = 12
MinValue = 2
TabOrder = 8
TabOrder = 6
Value = 4
end
object prefVerbose: TCheckBox
Expand All @@ -347,7 +347,7 @@ object ABRelay: TABRelay
Width = 82
Height = 25
Caption = 'Verbose.'
TabOrder = 9
TabOrder = 7
end
object prefTrimPartialTeams: TCheckBox
Left = 253
Expand All @@ -358,20 +358,17 @@ object ABRelay: TABRelay
Checked = True
Enabled = False
State = cbChecked
TabOrder = 10
TabOrder = 8
end
object rgrpAlgorithm: TRadioGroup
Left = 22
Top = 230
Width = 225
Height = 95
Caption = 'Pack Method.'
Enabled = False
ItemIndex = 0
Items.Strings = (
'SCM bin pack routine.'
'Generic Algorithm.')
TabOrder = 11
object spnAcceptableMargin: TSpinEdit
Left = 160
Top = 283
Width = 63
Height = 31
MaxValue = 100
MinValue = 10
TabOrder = 10
Value = 20
end
end
object bhintABRelay: TBalloonHint
Expand Down
44 changes: 34 additions & 10 deletions AUTOBUILD/dlgABRelay.pas
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ TABRelay = class(TForm)
Label1: TLabel;
Image1: TImage;
pnlPrefences: TPanel;
lbl7: TLabel;
lbl8: TLabel;
lblSeedDepth: TLabel;
lblMemberMissingData: TLabel;
lblPercent: TLabel;
prefHeatAlgorithm: TRadioGroup;
prefUseDefRaceTime: TCheckBox;
prefRaceTimeTopPercent: TSpinEdit;
prefExcludeOutsideLanes: TCheckBox;
prefSeperateGender: TCheckBox;
rgpSeedMethod: TRadioGroup;
spnSeedDepth: TSpinEdit;
prefDoHouseRelays: TCheckBox;
prefNumOfSwimmersPerTeam: TSpinEdit;
lblSwimmersPerTeam: TLabel;
Expand All @@ -39,13 +36,17 @@ TABRelay = class(TForm)
vimgHint2: TVirtualImage;
vimgHint3: TVirtualImage;
rgrpAlgorithm: TRadioGroup;
spnAcceptableMargin: TSpinEdit;
lblAcceptableMargin: TLabel;
vimgPackMethod: TVirtualImage;
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure vimgHint1Click(Sender: TObject);
procedure vimgHintMouseLeave(Sender: TObject);
procedure vimgHint2Click(Sender: TObject);
procedure vimgHint3Click(Sender: TObject);
procedure vimgPackMethodClick(Sender: TObject);
private
{ Private declarations }
procedure ReadPreferences(IniFileName: string);
Expand Down Expand Up @@ -115,10 +116,15 @@ procedure TABRelay.ReadPreferences(IniFileName: string);
integer(cbUnchecked)));
prefSeperateGender.State := TCheckBoxState(iFile.ReadInteger('Preferences',
'SeperateGender', integer(cbUnchecked)));

// prefGroupBy.ItemIndex := iFile.ReadInteger('Preferences', 'GroupBy', 0);
rgpSeedMethod.ItemIndex := iFile.ReadInteger('Preferences', 'SeedMethod', 0);
// rgpSeedMethod.ItemIndex := iFile.ReadInteger('Preferences', 'SeedMethod', 0);

// 2020-11-01 auto-build v2 seed depth for Circle Seed */
spnSeedDepth.Value := (iFile.ReadInteger('Preferences', 'SeedDepth', 3));
// spnSeedDepth.Value := (iFile.ReadInteger('Preferences', 'SeedDepth', 3));

// 2024-10-3 auto-build relays acceptable margin for refined algorithm */
spnAcceptableMargin.Value := (iFile.ReadInteger('Preferences', 'AcceptableMargin', 20));

// 2024-09-10
// Relay teams, by default, have four swimmers.
Expand Down Expand Up @@ -158,12 +164,25 @@ procedure TABRelay.vimgHint3Click(Sender: TObject);
bhintABRelay.Title := 'Group by Club-House .';
bhintABRelay.Description := '''
Relay teams will only be allowed swimmers that share
the same 'House' (as designated in the member's profile).
the same House ...as designated in the member's profile.
''';
bhintABRelay.ShowHint(vimgHint3);

end;

procedure TABRelay.vimgPackMethodClick(Sender: TObject);
begin
bhintABRelay.Title := 'Pack Method';
bhintABRelay.Description := '''
The Basic pack method is ideal when members' race times vary widely. It uses this broad range to build teams.
The Refined method should be used when members' Time-To-Beat (TTB) values are closely grouped together.
The Acceptable margin sets a threshold for team member selection; default is 20%, adjustable from 10% to 60%. Lower margins are recommended for groups with less variation in TTB.
The Genetic Algorithm takes longer and may yield unpredictable results but often outperforms other methods by simulating natural selection principles to optimize team composition.
''';
bhintABRelay.ShowHint(vimgPackMethod);
end;


procedure TABRelay.WritePreferences(IniFileName: string);
var
iFile: TIniFile;
Expand All @@ -186,9 +205,14 @@ procedure TABRelay.WritePreferences(IniFileName: string);
iFile.WriteInteger('Preferences', 'SeperateGender',
integer(prefSeperateGender.State));
// iFile.WriteInteger('Preferences', 'GroupBy', prefGroupBy.ItemIndex);
iFile.WriteInteger('Preferences', 'SeedMethod', rgpSeedMethod.ItemIndex);
// iFile.WriteInteger('Preferences', 'SeedMethod', rgpSeedMethod.ItemIndex);

// 2020-11-01 auto-build v2 seed depth for Circle Seed */
iFile.WriteInteger('Preferences', 'SeedDepth', (spnSeedDepth.Value));
// iFile.WriteInteger('Preferences', 'SeedDepth', (spnSeedDepth.Value));

// 2024-10-3 auto-build relays acceptable margin for refined algorithm */
iFile.WriteInteger('Preferences', 'AcceptableMargin', (spnAcceptableMargin.Value));


// 2024-09-10
// Relay teams, by default, have four swimmers.
Expand Down
Loading

0 comments on commit bbf3636

Please sign in to comment.