• Sign in to follow this  

    Load factor setting for phpvms scripts

    • Status: Pending Type: Suggestion

    I am hoping we can get a setting to adjust the load factor in the web server scripts. Currently it looks like smartCARS pulls the value set in local.config.php and then has some preset range of variance. Some other ACARS programs allow adjustment to increase the range of randomness of the cargo weight/pax, and I'd like the ability to do the same to allow for some lightly loaded flights, with some up to near max capacity.

    Ultimately, I was really hoping to eventually add an entry in the sql tables for a load factor setting that can be queried by smartCARS. This is to better emulate pure cargo operations.

    Sign in to follow this  

    User Feedback

    Recommended Comments

    You should be able to achieve this by editing the smartCARS interface.php file - there are some options in there to specify different load types.

    Share this comment

    Link to comment
    Share on other sites

    The below is the only load settings I see in interface.php. From what I read I have three options. None of which get to what what I'm talking about. Basically I'm looking to set the randomness in the load generation. Will adding a php value like $schedule['load']=rand(60,95) work here? 


    			if($schedule['id'] != "") {
    				$schedule['bidid'] = $bid['bidid'];
    				//How the 'load' value works:
    				//You can give a number that will be used as the passenger or cargo number in the client and it will not be editable by the user.
    				//You can specify LOAD_TYPE_RANDOM_LOCKED that will generate a random number on the client side but will not allow editing.
    				//You can specify LOAD_TYPE_RANDOM_EDITABLE that will function like smartCARS 1.X - generate a random number and allow the user to change it.				
    				$continue = false;
    				if($schedule['enabled'] != "0")
    					$continue = true;
    				else {
    					$stmt = $dbConnection->prepare("SELECT * FROM smartCARS_charteredflights WHERE routeid = ? AND dbid = ?");
    					$stmt->execute(array($bid['routeid'], $dbid));
    					$cschedule = $stmt->fetch();
    					if($cschedule['routeid'] != "")
    						$continue = true;
    				$schedule['load'] = LOAD_TYPE_RANDOM_EDITABLE;


    Share this comment

    Link to comment
    Share on other sites

    I was hoping to revisit this topic. I'm still searching for a solution to get control of the smartCARS generated load. Basically, in my opinion its too high for cargo only airlines. When I keep clicking generate load, it generates values ranging resulting in a load factor from the mid to high 70's to upper 90's. This is despite what I have set in the phpvms local config file of 66%. Thats great for pax airlines which often have high load factors, but freighters aren't often nearly as full. What I need help with is adding code to basically do:

    Aircraft Max Cargo * (+/- say 15% of Global load factor from local.config.php)  = SmartCARS load. I put an ugly formula in there to try to  better illustrate what I'm talking show real numbers. The 68050 number is the maxcargo value for my 757-200SF's, just for reference. Just have to find out how to properly query this in the smartcars interface.php script.

    if 'flighttype' = 'C' { 
    	$schedule['load'] = 68050 * ((rand(85,115)/100) * (66/100)

    If I we can get a statement like that working, I think that opens up more opportunities like setting up a php formula to check if month = 12 then load factor = a higher number.

    Share this comment

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now