Starsector API
Loading...
Searching...
No Matches
MarketConnectionActivityDataOld.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.shared;
2
3
5
6// public static Logger log = Global.getLogger(MarketConnectionActivityData.class);
7//
8// private float econInterval = Global.getSettings().getFloat("economyIntervalnGameDays");
9// private IntervalUtil timer = new IntervalUtil(0.25f, .75f);
10//
11// private RollingAverageTracker tradePointsSent;
12// private RollingAverageTracker tradePointsLost;
13// private RollingAverageTracker smugglingPointsSent;
14// private RollingAverageTracker smugglingPointsLost;
15//
16// private final String connId;
17//
18// //private MarketConnectionAPI conn;
19//
20// public MarketConnectionActivityData(String connectionId) {
21// this.connId = connectionId;
22// float min = econInterval - Math.min(econInterval * 0.5f, 2f);
23// float max = econInterval + Math.min(econInterval * 0.5f, 2f);
24// tradePointsSent = new RollingAverageTracker(min, max, StarSystemActivityTracker.ROLLING_AVG_FACTOR);
25// tradePointsLost = new RollingAverageTracker(min, max, StarSystemActivityTracker.ROLLING_AVG_FACTOR);
26// smugglingPointsSent = new RollingAverageTracker(min, max, StarSystemActivityTracker.ROLLING_AVG_FACTOR);
27// smugglingPointsLost = new RollingAverageTracker(min, max, StarSystemActivityTracker.ROLLING_AVG_FACTOR);
28//
29// timer = new IntervalUtil(min, max);
30// }
31//
32// public void advance(float days) {
33// timer.advance(days);
34//
35// float e = timer.getElapsed() / timer.getIntervalDuration();
36// tradePointsSent.setElaspedFractionOverride(e);
37// tradePointsLost.setElaspedFractionOverride(e);
38// smugglingPointsSent.setElaspedFractionOverride(e);
39// smugglingPointsLost.setElaspedFractionOverride(e);
40//
41// if (timer.intervalElapsed()) {
42// tradePointsSent.updateAverage();
43// tradePointsLost.updateAverage();
44// smugglingPointsSent.updateAverage();
45// smugglingPointsLost.updateAverage();
46//
47// log.info(String.format("Updating connection: [" + connId + "]: trade (s: %d, l: %d), smuggling: (s: %d, l: %d)",
48// (int) tradePointsSent.getAverage(), (int) tradePointsLost.getAverage(),
49// (int) smugglingPointsSent.getAverage(), (int) smugglingPointsLost.getAverage()));
50// }
51//
52// }
53//
54//
55// public RollingAverageTracker getTradePointsSent() {
56// return tradePointsSent;
57// }
58//
59//
60// public RollingAverageTracker getTradePointsLost() {
61// return tradePointsLost;
62// }
63//
64//
65// public RollingAverageTracker getSmugglingPointsSent() {
66// return smugglingPointsSent;
67// }
68//
69//
70// public RollingAverageTracker getSmugglingPointsLost() {
71// return smugglingPointsLost;
72// }
73//
74// public MarketConnectionAPI getConnection() {
75// return Global.getSector().getEconomy().getConnection(connId);
76// }
77//
90
91
92}
93
94
95
96
97
98
99
100
101
102