XiozZe / XioScript

XioScript
11 stars 16 forks source link

Modification: stock supply #94

Closed TeaMike closed 8 years ago

TeaMike commented 8 years ago

I don't find the default setting "stock" 3x practical: it creates unnecessary extra stock and if a supply chain breaks temporarily, the last subdivision has to wait until all the previous ones are (over-)stocked until it receives any supply. I modified the code at around line 1090 so only a full quantity of "required" only is maintained/ordered; so far this seems to work well:

        else if(choice[0] === 3 && mapped[url].isProd){
            newsupply =  Math.min(2 * mapped[url].required[i]- mapped[url].stock[i], Math.max(1 * mapped[url].required[i], 0)); 
        }
        else if(choice[0] === 3 && !mapped[url].isProd){
            newsupply =  Math.min(2 * mapped[url2].consump[i]- mapped[url].stock[i], Math.max(1 * mapped[url2].consump[i], 0)); 
XiozZe commented 8 years ago

Formula added as extra option.