added more to PREDICTIVE document

changing some code in AST_VDadapt.pl for potential looping

git-svn-id: svn://192.168.202.10@223 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-08-26 03:56:20 +00:00
parent 4364280e99
commit 7c5a38c81e
2 changed files with 82 additions and 52 deletions
+62 -50
View File
@@ -16,55 +16,7 @@ $US='__';
$MT[0]=''; $MT[0]='';
$secT = time(); $secT = time();
$secX = time(); &get_time_now;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$Fhour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$file_date = "$year-$mon-$mday";
$now_date = "$year-$mon-$mday $hour:$min:$sec";
$VDL_date = "$year-$mon-$mday 00:00:01";
$current_hourmin = "$hour$min";
### get date-time of one hour ago ###
$VDL_hour = ($secX - (60 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_hour);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_hour = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### get date-time of half hour ago ###
$VDL_halfhour = ($secX - (30 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_halfhour);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_halfhour = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### get date-time of five minutes ago ###
$VDL_five = ($secX - (5 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_five);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_five = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### get date-time of one minute ago ###
$VDL_one = ($secX - (1 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_one);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_one = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### begin parsing run-time options ### ### begin parsing run-time options ###
if (length($ARGV[0])>1) if (length($ARGV[0])>1)
@@ -78,7 +30,7 @@ if (length($ARGV[0])>1)
if ($args =~ /--help/i) if ($args =~ /--help/i)
{ {
print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n\n"; print "allowed run time options(must stay in this order):\n [--debug] = debug\n [--debugX] = super debug\n [--dbgmt] = show GMT offset of records as they are inserted into hopper\n [-t] = test\n [--level=XXX] = force a hopper_level of XXX\n [--campaign=XXX] = run for campaign XXX only\n [-force] = force calculation of suggested predictive dial_level\n [-test] = test only, do not alter dial_level\n\n";
} }
else else
{ {
@@ -179,6 +131,11 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
or die "Couldn't connect to database: " . DBI->errstr; or die "Couldn't connect to database: " . DBI->errstr;
### Start loop code ###
### Grab Server values from the database ### Grab Server values from the database
$stmtA = "SELECT vd_server_logs,local_gmt FROM servers where server_ip = '$VARserver_ip';"; $stmtA = "SELECT vd_server_logs,local_gmt FROM servers where server_ip = '$VARserver_ip';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
@@ -885,4 +842,59 @@ if ($SYSLOG)
close(Aout); close(Aout);
} }
$adaptive_string=''; $adaptive_string='';
}
sub get_time_now
{
$secX = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$Fhour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$file_date = "$year-$mon-$mday";
$now_date = "$year-$mon-$mday $hour:$min:$sec";
$VDL_date = "$year-$mon-$mday 00:00:01";
$current_hourmin = "$hour$min";
### get date-time of one hour ago ###
$VDL_hour = ($secX - (60 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_hour);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_hour = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### get date-time of half hour ago ###
$VDL_halfhour = ($secX - (30 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_halfhour);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_halfhour = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### get date-time of five minutes ago ###
$VDL_five = ($secX - (5 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_five);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_five = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
### get date-time of one minute ago ###
$VDL_one = ($secX - (1 * 60));
($Vsec,$Vmin,$Vhour,$Vmday,$Vmon,$Vyear,$Vwday,$Vyday,$Visdst) = localtime($VDL_one);
$Vyear = ($Vyear + 1900);
$Vmon++;
if ($Vmon < 10) {$Vmon = "0$Vmon";}
if ($Vmday < 10) {$Vmday = "0$Vmday";}
$VDL_one = "$Vyear-$Vmon-$Vmday $Vhour:$Vmin:$Vsec";
} }
+20 -2
View File
@@ -17,12 +17,30 @@ The first set of data we want to gather is the recent queue and agent statistics
This number if positive means that on average more agents were waiting for calls than calls waiting for agents in the last minute for that campaign. This number if positive means that on average more agents were waiting for calls than calls waiting for agents in the last minute for that campaign.
The second set of data to gather is dropped call information across several intervals. This information will be gathered by the actual AST_VDadapt.pl script that will also be the script actually changing the dial level when the predictive/adaptive dial method is activated. Once a minute this script will gather: The second set of data to gather is dropped call information across several intervals. This information will be gathered by the actual AST_VDadapt.pl script that will also be the script actually changing the dial level when the predictive/adaptive dial method is activated. Once a minute this script will gather:
1. total drops and total calls for the campaign since midnight 1. Total drops and total calls for the campaign since midnight
2. Total drops and total calls for the campaign in the past hour 2. Total drops and total calls for the campaign in the past hour
3. Total drops and total calls for the campaign in the past half hour hour 3. Total drops and total calls for the campaign in the past half hour
4. Total drops and total calls for the campaign in the past five minutes 4. Total drops and total calls for the campaign in the past five minutes
5. Total drops and total calls for the campaign in the past one minute 5. Total drops and total calls for the campaign in the past one minute
Also, the drop percentage is calculated and stored in the vicidial_campaign_stats table. Also, the drop percentage is calculated and stored in the vicidial_campaign_stats table.
The settings in the campaign detail screen:
Dial Method - This field is the way to define how dialing is to take place. If MANUAL then the auto_dial_level will be locked at 0 unless Dial Method is changed. If RATIO then the normal dialing a number of lines for Active agents. ADAPT_HARD_LIMIT will dial predictively up to the dropped percentage and then not allow aggressive dialing once the drop limit is reached until the percentage goes down again. ADAPT_TAPERED allows for running over the dropped percentage in the first half of the shift(as defined by call_time selected for campaign) and gets more strict as the shift goes on. ADAPT_AVERAGE tries to maintain an average or the dropped percentage not imposing hard limits as aggressively as the other two methods.
Auto Dial Level - This is where you set how many lines VICIDIAL should use per active agent. zero 0 means auto dialing is off and the agents will click to dial each number. Otherwise VICIDIAL will keep dialing lines equal to active agents multiplied by the dial level to arrive at how many lines this campaign on each server should allow.
Available Only Tally - This field if set to Y will leave out INCALL and QUEUE status agents when calculating the number of calls to dial when not in MANUAL dial mode. Default is N.
Drop Percentage Limit - This field is where you set the limit of the percentage of dropped calls you would like while using an adaptive-predictive dial method, not MANUAL or RATIO.
Maximum Adapt Dial Level - This field is where you set the limit of the limit to the numbr of lines you would like dialed per agent while using an adaptive-predictive dial method, not MANUAL or RATIO. This number can be higher than the Auto Dial Level if your hardware will support it. Value must be a positive number greater than one and can have decimal places Default 3.0.
Latest Target Timezone - This field is only used by the ADAPT_TAPERED dial method. You should select the current GMT offset value or timezone of the latest region that you will be calling. This allows the Tapered algorithm to decide how aggressively to dial by how long you have until you will be finished calling. NOTE- If you are calling in the USA and you have a very small amount of leads in Alaska or Hawaii but many leads in Pacific time zone, you should choose the pacific time zone for this field for the ADAPT_TAPERED dial method to work properly.
Adapt Intensity Modifier - This field is used to adjust the predictive intensity either higher or lower. The higher a positive number you select, the greater the dialer will increase the call pacing when it goes up and the slower the dialer will decrease the call pacing when it goes down. The lower the negative number you select here, the slower the dialer will increase the call pacing and the faster the dialer will lower the call pacing when it goes down. Default is 0. This field is not used by the MANUAL or RATIO dial methods.
To use adaptive dialing you must have the AST_VDadapt.pl script in your crontab running every minute. To use adaptive dialing you must have the AST_VDadapt.pl script in your crontab running every minute.