SHARE
TWEET
FL Silken Thread expedition sim
a guest
Jun 6th, 2019
340
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import java.text.DecimalFormat;
- /**
- * For estimating EPA of the Silken Thread FL expedition using various supply
- * sources
- *
- * @author umbralOptimatum
- *
- */
- public class expeditionStats {
- // profit of test expedition in echoes
- public static final int expeditionProfit = 125;
- // Archaeologist's Progress needed to complete expedition
- public static final int progressGoal = 30;
- /**
- * Simulates expeditions, not taking supply gain into account
- *
- * @param tests
- * - number of expeditions to simulate
- * @return an array of three doubles: net profit, action cost, and supply cost
- * in that order
- */
- public static double[] expeditionSim(int tests) {
- // current expedition number
- int expedition = 0;
- // progress on current expedition
- int progress;
- // rivals progress for current expedition
- int rivals;
- // total supplies used across all expeditions
- double supplies = 0;
- // total actions used across all expeditions
- double actions = 0;
- // total echoes generated
- double echoes = 0;
- while (expedition < tests) {
- progress = 1;
- rivals = 1;
- // starting the expedition
- actions++;
- while (progress < progressGoal) {
- actions++;
- // if Airs of the Forgotten Quarter are at least 96, use A sign?
- if (Math.floor(Math.random() * 100) >= 95) {
- progress += 4;
- } else {
- /*
- * During an expedition, you ideally want your final action to be Buccaneering.
- * That way, if you get A sign? you'll get as much value as possible from it,
- * but can still finish in one action the other 95% of the time. These rules are
- * the best order I've found for maximizing potential sign value without using
- * additional actions the rest of the time.
- */
- if (progress == (progressGoal - 4) || progress == (progressGoal - 1)) {
- supplies++;
- progress++;
- if (Math.random() < .25) {
- rivals++;
- }
- } else if (progress == (progressGoal - 2) || progress == (progressGoal - 5)
- || progress == (progressGoal - 8)) {
- supplies += 2;
- progress += 2;
- if (Math.random() < .5) {
- rivals++;
- }
- } else {
- supplies += 3;
- progress += 3;
- if (Math.random() < .5) {
- rivals++;
- }
- }
- /*
- * This simulation assumes always having the ten spare supplies on hand.
- * Confronting the Lugubrious Seamstress also gives 5 CP Nightmares but this
- * happens rarely enough that they can be dealt with through normal play. The
- * random progress gain should always be enough to hit 30 for Silken Thread, but
- * I'm leaving it in there just in case.
- */
- if (rivals == 10) {
- actions++;
- supplies += 10;
- echoes -= 5;
- progress += 2 + Math.ceil(3 * Math.random());
- }
- }
- }
- actions++;
- expedition++;
- }
- // add net profit from the expeditions
- echoes += tests * expeditionProfit;
- System.out.println(tests + " expeditions simulated");
- System.out.println(echoes + " net echoes");
- System.out.println(actions + " total actions");
- System.out.println(supplies + " supplies used");
- System.out.println((echoes / tests) + " average profit before supplies");
- System.out.println((actions / tests) + " average action cost");
- System.out.println((supplies / tests) + " average supply cost\n");
- double[] returnArray = { echoes, actions, supplies };
- return returnArray;
- }
- /**
- * Estimates EPA for simulated expeditions using Docks favours for expedition
- * supplies
- *
- * @param stats
- * - array containing results from expeditionSim
- * @param costEchoes
- * - echo cost of one favour in materials already on hand. E.x. using
- * Docks card requires 10 Rostygold, or 0.1 echoes
- * @param costActions
- * - action cost of grinding materials needed for one favour
- */
- public static void expeditionDocksFavours(double[] stats, double costEchoes, double costActions) {
- // total echoes generated by simulation
- double echoes = stats[0];
- // total actions used across all expeditions
- double actions = stats[1];
- // total supplies used across all expeditions
- double supplies = stats[2];
- /*
- * Using each Docks favour costs .5 echoes rostygold on top of additional costs;
- * rostygold is assumed to accumulate fast enough that it doesn't need to be
- * ground (i.e. through visiting the Soldier and cashing in rats as needed)
- */
- echoes -= (.5 + costEchoes) * supplies / 4;
- /*
- * Using each Docks favour costs two actions, one to obtain and one to cash in,
- * plus any needed to grind materials
- */
- actions += (2 + costActions) * supplies / 4;
- String EPA = new DecimalFormat("#.####").format(echoes / actions);
- System.out.println("Docks Favours (" + costEchoes + " echo cost, " + costActions + " action cost)");
- System.out.println(EPA + " EPA\n");
- }
- /**
- * Estimates EPA for simulated expeditions using Strong-backed Labour for
- * expedition supplies
- *
- * @param stats
- * - array containing results from expeditionSim
- */
- public static void expeditionSBL(double[] stats) {
- // total echoes generated by simulation
- double echoes = stats[0];
- // total actions used across all expeditions
- double actions = stats[1];
- // total supplies used across all expeditions
- double supplies = stats[2];
- // SBL costs a constant 13.5 echoes per 5 supplies
- echoes -= 13.5 * supplies / 5;
- // two actions to acquire and cash in each SBL
- actions += 2 * supplies / 5;
- String EPA = new DecimalFormat("#.####").format(echoes / actions);
- System.out.println("Strong-backed Labour:");
- System.out.println(EPA + " EPA\n");
- }
- /**
- * Estimates EPA for simulated expeditions using Whispered Hints for expedition
- * supplies
- *
- * @param stats
- * - array containing results from expeditionSim
- * @param hintsPerAction
- * - average hints per action from a particular grind
- * @param costEchoes
- * - average echo cost of materials for one action in hint grind,
- * does not include cost of materials being ground. If grinding
- * creates those items, make this negative!
- */
- public static void expeditionHints(double[] stats, double hintsPerAction, double echoesPerAction) {
- // total echoes generated by simulation
- double echoes = stats[0];
- // total actions used across all expeditions
- double actions = stats[1];
- // total supplies used across all expeditions
- double supplies = stats[2];
- // actions spent acquiring supplies via hints (assuming 60/40 split in the
- // supply results)
- double supplyActions = supplies / 1.4;
- actions += supplyActions;
- // 60% chance of one Map Scrap
- echoes += supplyActions * .1 * .6;
- // if any grinding is involved
- if (hintsPerAction != 0) {
- actions += 200 / hintsPerAction * supplyActions;
- echoes -= 200 / hintsPerAction * supplyActions * echoesPerAction;
- }
- // if just using owned hints, or buying outright
- else {
- echoes -= echoesPerAction * supplyActions;
- }
- System.out.println("Whispered Hints (" + hintsPerAction + " hints per action, " + echoesPerAction + " echo cost per action)");
- String EPA = new DecimalFormat("#.####").format(echoes / actions);
- System.out.println(EPA + " EPA\n");
- }
- public static void main(String[] args) {
- double[] stats = expeditionSim(10000000);
- expeditionSBL(stats);
- System.out.println("Free favours:");
- expeditionDocksFavours(stats, 0, 0);
- System.out.println("Docks card (.1 echo cost):");
- expeditionDocksFavours(stats,.1, 0);
- System.out.println("Galatea card (.5 echo cost):");
- expeditionDocksFavours(stats,.5,0);
- System.out.println("Galatea card (grinding hints at 150 per action):");
- expeditionDocksFavours(stats,0,.33333);
- System.out.println("Using owned hints for supplies:");
- expeditionHints(stats,0,2);
- System.out.println("Trading owned items to Tiger-Keeper:");
- expeditionHints(stats,1100,10);
- System.out.println("Grinding Tiger-Keeper items via Court");
- expeditionHints(stats,138.46,-0.01993);
- System.out.println("Various cards that give 150 hints");
- expeditionHints(stats,150,0);
- System.out.println("Respectable Landeau card");
- expeditionHints(stats,150,-.6);
- }
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
