Mathhammer

A framework for determining the probabilities and statistics of the game of Warhammer 40,000 (8th and 9th Editions)

Лицензия

Лицензия

Группа

Группа

com.cogpunk
Идентификатор

Идентификатор

mathhammer
Последняя версия

Последняя версия

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Mathhammer
A framework for determining the probabilities and statistics of the game of Warhammer 40,000 (8th and 9th Editions)
Ссылка на сайт

Ссылка на сайт

https://github.com/cogpunk/mathhammer
Система контроля версий

Система контроля версий

https://github.com/cogpunk/math

Скачать mathhammer

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.cogpunk/mathhammer/ -->
<dependency>
    <groupId>com.cogpunk</groupId>
    <artifactId>mathhammer</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.cogpunk/mathhammer/
implementation 'com.cogpunk:mathhammer:1.0.0'
// https://jarcasting.com/artifacts/com.cogpunk/mathhammer/
implementation ("com.cogpunk:mathhammer:1.0.0")
'com.cogpunk:mathhammer:jar:1.0.0'
<dependency org="com.cogpunk" name="mathhammer" rev="1.0.0">
  <artifact name="mathhammer" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.cogpunk', module='mathhammer', version='1.0.0')
)
libraryDependencies += "com.cogpunk" % "mathhammer" % "1.0.0"
[com.cogpunk/mathhammer "1.0.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.cogpunk : cogpunk-math jar 1.0.0

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.13.1

Модули Проекта

Данный проект не имеет модулей.

Cogpunk Math

Cogpunk Math is a set of mathematical utilities for general use

Build Status Quality Gate Status Coverage Maintainability Rating Reliability Rating Security Rating Apache License, Version 2.0 Cogpunk Math

Building from source

The build requires a Java 6 JDK (or higher) and uses Maven

mvn install

Adding as a dependency

<dependency>
	<groupId>com.cogpunk</groupId>
	<artifactId>cogpunk-math</artifactId>
	<version>1.0.1</version>
</dependency>

License

Code is under the Apache Licence v2.

Example

Determine the probability profile of adding 3 six-sided dice together

// Create a profile for a 6-sided dice

Fraction prob = new Fraction(1, 6);

Map<Integer, Fraction> map = new TreeMap<Integer, Fraction>();

for (int n = 1; n <= 6; n++) {
	map.put(n, prob);
}

ComparableEventProbabilityProfileImpl<Integer, Fraction> dice 
	= new ComparableEventProbabilityProfileImpl<Integer, Fraction>(
		map, new FractionOperator());

// Determine the probabilities of all possible results of adding the dice values together 
// using the EventProbabilityProfileAdditionAggregationStrategy

EventProbabilityProfileAggregator<Integer, Integer, Fraction> aggregator 
	= new EventProbabilityProfileAggregator<Integer, Integer, Fraction>(
		new EventProbabilityProfileAdditionAggregationStrategy<Integer>(
			new IntegerOperator()), new FractionOperator(), dice, dice, dice);

// Print out the results to the console

System.out.println(aggregator);

Версии библиотеки

Версия
1.0.0