public class AmaltheaServices
extends Object
The methods are called from several generated model objects.
Modifier and Type | Field and Description |
---|---|
static List<TimeUnit> |
TIME_UNIT_LIST |
Constructor and Description |
---|
AmaltheaServices() |
Modifier and Type | Method and Description |
---|---|
static @NonNull Time |
addTime(@NonNull Time t1,
@NonNull Time t2) |
static @NonNull Time |
adjustTimeUnit(@NonNull Time time)
This method takes a time (in value and unit) and adjusts the TimeUnit so that
the value is as small as possible, without losing precision e.g. 1000us is
converted to 1ms
|
static int |
compareDataRates(@NonNull DataRate r1,
@NonNull DataRate r2)
This method is used to compare DataRate objects on the basis of their values
(obtained in bit per second after applying the conversion based on DataRateUnit)
|
static int |
compareTimes(@NonNull Time t1,
@NonNull Time t2)
This method is used to compare Time objects on the basis of their values
(obtained in pico seconds after applying the conversion based on TimeUnit)
|
static BigInteger |
convertToBit(@NonNull DataSize size) |
static BigInteger |
convertToBitPerSecond(@NonNull DataRate rate) |
static BigDecimal |
convertToHertz(@NonNull Frequency frequency) |
static BigDecimal |
convertToMicroVolt(@NonNull Voltage voltage) |
static BigInteger |
convertToPicoSeconds(@NonNull Time time)
This method is used to convert the value of Time/TimeObject element's value
to BigInteger in Pico Seconds
|
static double |
divideTime(@NonNull Time t1,
@NonNull Time t2) |
static EList<HwModule> |
getAllModules(@NonNull HwStructure struct) |
static Double |
getAverageOfBetaDistribution(@NonNull Number a,
@NonNull Number b,
double alpha,
double beta) |
static Time |
getAverageOfBetaDistribution(@NonNull Time a,
@NonNull Time b,
double alpha,
double beta) |
static double |
getAverageOfTruncatedNormalDistribution(@Nullable Number a,
@Nullable Number b,
double mean,
double sd)
Computes the average (mean) of the truncated normal distribution
See
Truncated normal distribution (Wikipedia)
|
static @NonNull Time |
getAverageOfTruncatedNormalDistribution(@Nullable Time a,
@Nullable Time b,
@NonNull Time mean,
@NonNull Time sd)
Computes the average (mean) of the truncated normal distribution
See
Truncated normal distribution (Wikipedia)
|
static <T extends EObject> |
getContainerOfType(@NonNull EObject object,
@NonNull Class<T> type) |
static EList<HwPort> |
getInnerPorts(@NonNull HwStructure struct) |
static EList<QualifiedPort> |
getInnerPorts(@NonNull ISystem system) |
static @NonNull Time |
multiply(@NonNull Time t1,
double value) |
static @NonNull Time |
multiply(@NonNull Time t1,
long value) |
static @NonNull Time |
subtractTime(@NonNull Time t1,
@NonNull Time t2) |
public static <T extends EObject> T getContainerOfType(@NonNull EObject object, @NonNull Class<T> type)
public static BigInteger convertToBit(@NonNull DataSize size)
public static BigInteger convertToBitPerSecond(@NonNull DataRate rate)
public static BigInteger convertToPicoSeconds(@NonNull Time time)
time
- Time objectpublic static BigDecimal convertToHertz(@NonNull Frequency frequency)
public static BigDecimal convertToMicroVolt(@NonNull Voltage voltage)
public static int compareDataRates(@NonNull DataRate r1, @NonNull DataRate r2)
r1
- DataRate objectr2
- DataRate objectpublic static int compareTimes(@NonNull Time t1, @NonNull Time t2)
t1
- Time objectt2
- Time objectpublic static @NonNull Time adjustTimeUnit(@NonNull Time time)
time
- public static @NonNull Time addTime(@NonNull Time t1, @NonNull Time t2)
public static @NonNull Time subtractTime(@NonNull Time t1, @NonNull Time t2)
public static double divideTime(@NonNull Time t1, @NonNull Time t2)
public static @NonNull Time multiply(@NonNull Time t1, long value)
public static @NonNull Time multiply(@NonNull Time t1, double value)
public static @NonNull Time getAverageOfTruncatedNormalDistribution(@Nullable Time a, @Nullable Time b, @NonNull Time mean, @NonNull Time sd)
a
- lower bound (null = not truncated from below)b
- upper bound (null = not truncated from above)mean
- mean or expectation of the (unlimited) distributionsd
- standard deviationpublic static double getAverageOfTruncatedNormalDistribution(@Nullable Number a, @Nullable Number b, double mean, double sd)
a
- lower bound (null = not truncated from below)b
- upper bound (null = not truncated from above)mean
- mean or expectation of the (unlimited) distributionsd
- standard deviationpublic static Time getAverageOfBetaDistribution(@NonNull Time a, @NonNull Time b, double alpha, double beta)
public static Double getAverageOfBetaDistribution(@NonNull Number a, @NonNull Number b, double alpha, double beta)
public static EList<QualifiedPort> getInnerPorts(@NonNull ISystem system)
public static EList<HwPort> getInnerPorts(@NonNull HwStructure struct)
public static EList<HwModule> getAllModules(@NonNull HwStructure struct)