public class BezierPriceCalculation extends BasePriceCalulation
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.collect.Multimap<ITradable,javafx.geometry.Point2D> |
cacheBuy |
private com.google.common.collect.Multimap<ITradable,javafx.geometry.Point2D> |
cacheSell |
| Constructor and Description |
|---|
BezierPriceCalculation() |
| Modifier and Type | Method and Description |
|---|---|
javafx.geometry.Point2D |
caclulateBezierPoint(double t,
javafx.geometry.Point2D start,
javafx.geometry.Point2D cp1,
javafx.geometry.Point2D cp2,
javafx.geometry.Point2D end)
Calculate the point (x,y-coordinates) on the bezier curve defined by the four control points for
parameter
t |
List<javafx.geometry.Point2D> |
calculateDiscreteBezierPoints(javafx.geometry.Point2D start,
javafx.geometry.Point2D cp1,
javafx.geometry.Point2D cp2,
javafx.geometry.Point2D end)
Calculate a list of points at discrete x coordinates.
PRE: The bezier curve does not bend back on itself. |
int |
computePrice(ITradable tradable,
boolean buy,
int available,
int productionRate,
IPopulationStructure pop,
ECityState state)
Compute the price for one item of the ware.
|
private int |
getPrice(boolean buy,
ITradable tradable,
int available) |
getMaxValue, getMinValue, getSaturationprivate com.google.common.collect.Multimap<ITradable,javafx.geometry.Point2D> cacheBuy
private com.google.common.collect.Multimap<ITradable,javafx.geometry.Point2D> cacheSell
public javafx.geometry.Point2D caclulateBezierPoint(double t,
javafx.geometry.Point2D start,
javafx.geometry.Point2D cp1,
javafx.geometry.Point2D cp2,
javafx.geometry.Point2D end)
tt - Value in the range [0,1] defining the fragment length on the curve.start - control point marking the start of the curvecp1 - first control point defining the tangential direction of the curve leaving startcp2 - second control point defining the tangential direction of the curve going into endend - control point marking the end of the curve.t on the curve.public List<javafx.geometry.Point2D> calculateDiscreteBezierPoints(javafx.geometry.Point2D start, javafx.geometry.Point2D cp1, javafx.geometry.Point2D cp2, javafx.geometry.Point2D end)
start - control point marking the start of the curvecp1 - first control point defining the tangential direction of the curve leaving startcp2 - second control point defining the tangential direction of the curve going into endend - control point marking the end of the curve.public int computePrice(ITradable tradable, boolean buy, int available, int productionRate, IPopulationStructure pop, ECityState state)
IPriceCalculationV2tradable - defining all the parameters specific for the ware that is traded that is required for the calculationbuy - flag indicating if the calculation should happen for buying or selling.available - amount of wares that are available in the marketproductionRate - amount the city can produce within a weekpop - population structure that may have an influence on the calculated pricestate - state of the cityprivate int getPrice(boolean buy,
ITradable tradable,
int available)
Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.