Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PLUM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Land Use Lab
PLUM
Commits
f81f77db
Commit
f81f77db
authored
7 years ago
by
Peter Alexander
Browse files
Options
Downloads
Plain Diff
Automated merge with bundle:/var/folders/q0/_71d_v6x7_db44ndq976wzym0000gn/T/SourceTreeTemp.t5ImPa
parents
434713d1
75c96674
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ac/ed/lurg/country/GlobalPrice.java.orig
+0
-58
0 additions, 58 deletions
src/ac/ed/lurg/country/GlobalPrice.java.orig
with
0 additions
and
58 deletions
src/ac/ed/lurg/country/GlobalPrice.java.orig
deleted
100644 → 0
+
0
−
58
View file @
434713d1
package ac.ed.lurg.country;
import ac.ed.lurg.ModelConfig;
public class GlobalPrice {
double exportPrice;
double importAmount;
double exportAmount;
public GlobalPrice(double exportPrice, double importAmount, double exportAmount) {
this.exportPrice = exportPrice;
this.importAmount = importAmount;
this.exportAmount = exportAmount;
}
public static GlobalPrice createInitial(double exportPrice) {
return new GlobalPrice(exportPrice, Double.NaN, Double.NaN);
}
public double getExportPrice() {
return exportPrice;
}
public double getCountryImportPrice(double countryTradeBarrier) {
double importPrice = exportPrice * (1.0 + countryTradeBarrier*ModelConfig.TRADE_BARRIER_ADJ) / (1.0 - ModelConfig.TRANSPORT_LOSSES);
return importPrice;
}
public double getImportAmount() {
return importAmount;
}
public double getExportAmount() {
return exportAmount;
}
public GlobalPrice createWithUpdatedMarketPrices(double imports, double exports, boolean adjustPrice) {
if (imports > 0 || exports > 0) {
double ratio;
if (imports > exports)
ratio = (imports-exports)/imports;
else
ratio = (imports-exports)/exports;
double adjustment = adjustPrice ? Math.exp(ratio * ModelConfig.MARKET_LAMBA) : 1.0;
return new GlobalPrice(exportPrice * adjustment, imports, exports);
}
else {
return this;
}
}
@Override
public String toString() {
return String.format("export=%.3f", exportPrice);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment