Skip to content

Commit de9bee0

Browse files
Release version 1 (#11)
* Created JAR that is culmination of project for release. * Updated REAMME.md to have the How To Use section complete. * Added Drytron.txt as example * Corrected spelling mistakes, though will not take affect until JAR is recompiled. Not going to bother for V1.
1 parent c79d72f commit de9bee0

File tree

6 files changed

+119
-7
lines changed

6 files changed

+119
-7
lines changed
91.8 KB
Binary file not shown.

Input/Drytron.txt

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
//--simulation_results_console --input "Input/Drytron.txt"
2+
deck list:
3+
{
4+
Diviner of the Herald;
5+
Diviner of the Herald;
6+
Diviner of the Herald;
7+
Herald of Orange Light;
8+
Herald of Orange Light;
9+
Herald of Orange Light;
10+
Drytron Delta Altais;
11+
Drytron Gamma Eltanin;
12+
Drytron Gamma Eltanin;
13+
Drytron Zeta Aldhibah;
14+
Drytron Zeta Aldhibah;
15+
Drytron Zeta Aldhibah;
16+
Drytron Alpha Thuban;
17+
Drytron Alpha Thuban;
18+
Drytron Alpha Thuban;
19+
Eva;
20+
Drytron Meteonis Draconids;
21+
Herald of Perfection;
22+
Cyber Angel Benten;
23+
Cyber Angel Idaten;
24+
Cyber Angel Natasha;
25+
Megalith Ophiel;
26+
Megalith Phul;
27+
Megalith Phul;
28+
Cyber Emergency;
29+
Cyber Emergency;
30+
Cyber Emergency;
31+
Terraforming;
32+
Ursarctic Drytron;
33+
Drytron Nova;
34+
Drytron Nova;
35+
Drytron Nova;
36+
Preparation of Rites;
37+
Preparation of Rites;
38+
Meteonis Drytron;
39+
Dawn of the Herald;
40+
Called by the Grave;
41+
Drytron Fafnir;
42+
Drytron Fafnir;
43+
Ursarctic Big Dipper;
44+
}
45+
46+
//estimate
47+
scenarios:
48+
{
49+
Effective Drytron Fafnir = {scenario = {[Drytron Fafnir] OR [Terraforming]};display = false;}
50+
51+
//without Cyber Emergency for Draconids
52+
Effective Ritual = {scenario = {
53+
[Diviner of the Herald] OR [Drytron Meteonis Draconids] OR [Herald of Perfection] OR
54+
[Cyber Angel Benten] OR [Cyber Angel Idaten] OR [Cyber Angel Natasha] OR
55+
[Megalith Ophiel] OR [Megalith Phul] OR [Preparation of Rites]
56+
};display = false;}
57+
58+
//without Cyber Emergency nor Drytron Nova
59+
Effective Drytron Monster = {scenario = {[Drytron Delta Altais] OR [Drytron Alpha Thuban] OR [Drytron Gamma Eltanin] OR [Drytron Zeta Aldhibah]};display = false;}
60+
61+
Alpha + Zeta = {scenario = {
62+
([Drytron Alpha Thuban] AND [Drytron Zeta Aldhibah]) OR
63+
(([Drytron Alpha Thuban] OR [Drytron Zeta Aldhibah]) AND ([Cyber Emergency] OR <Effective Drytron Fafnir> OR [Drytron Nova])) OR
64+
([Cyber Emergency] AND (<Effective Drytron Fafnir> OR [Drytron Nova]))
65+
};}
66+
67+
Mu-Beta = {scenario = {
68+
(([Drytron Nova] OR <Effective Drytron Fafnir> OR [Drytron Alpha Thuban]) AND ([Cyber Emergency] OR [Drytron Delta Altais] OR [Drytron Gamma Eltanin])) OR
69+
(([Drytron Nova] OR <Effective Drytron Fafnir> OR [Drytron Alpha Thuban] OR [Cyber Emergency]) AND ([Drytron Delta Altais] OR [Drytron Gamma Eltanin])) OR
70+
([Drytron Gamma Eltanin] AND <Effective Ritual> AND ([Drytron Delta Altais] OR [Drytron Zeta Aldhibah]))
71+
};}
72+
73+
Beatrice = {scenario = {
74+
([Diviner of the Herald] AND ([Meteonis Drytron] OR [Herald of Perfection] OR [Cyber Angel Benten] OR [Cyber Angel Idaten] OR [Preparation of Rites]) AND ([Cyber Emergency] OR <Effective Drytron Monster> OR <Effective Drytron Fafnir> OR [Drytron Nova])) OR
75+
(([Cyber Angel Benten] OR [Preparation of Rites]) AND ([Cyber Emergency] OR <Effective Drytron Fafnir> OR [Drytron Nova] OR [Drytron Alpha Thuban] OR [Drytron Zeta Aldhibah]))
76+
/*
77+
Some other 4+ combos exist, but are not worth writing out due to being both being impractical and unlikely.
78+
-Phul, Level 6 Ritual, Meteonis, Alpha
79+
-Phul, Level 6 Ritual, Zeta, level >= 4
80+
-Phul, -Level 6 Ritual, Meteonis, Drytron, level >= 4
81+
*/
82+
};}
83+
84+
//Could be expanded a bit
85+
Protection = {scenario = {[Called By The Grave] OR ([Herald of Orange Light] AND ([Herald of Orange Light] OR [Eva] OR [Cyber Angel Natasha]))};}
86+
87+
Pre-BODE = {scenario = {<Alpha + Zeta> OR <Mu-Beta> OR <Beatrice>};}
88+
89+
Ursatron = {scenario = {
90+
([Ursarctic Drytron] AND [Ursarctic Big Dipper] AND ([Drytron Nova] OR (([Drytron Alpha Thuban] OR [Cyber Emergency]) AND (<Effective Ritual> OR <Effective Drytron Monster>)))) OR
91+
(([Drytron Nova] OR [Ursarctic Drytron]) AND <Effective Drytron Fafnir>)
92+
};}
93+
94+
Post-BODE = {scenario = {<Pre-BODE> OR <Ursatron>};}
95+
96+
Protected Post-BODE = {scenario = {<Post-BODE> AND <Protection>};}
97+
}

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22

33
## Introduction
44

5-
This application calculates the chance of drawing a particular hand from a given finite deck. Both are defined at runtime. Obviously, hands are drawn without replacement. The calculation is performed through simulation (due to the mathematics being a bit too complex for the complicated expressions that a user may define).
5+
This application calculates the chance of drawing a particular hand from a given finite deck. Both are defined at runtime. Obviously, hands are drawn without replacement. The calculation is performed through simulation (due to the mathematics requiring a dynamic exponential equation to account for overlapping scenarios).
66

77
Pull requests welcome.
88

99
## How To Use
1010

11-
//TODO: complete when application is ready for deployment
11+
### Prerequisites
12+
13+
Are simply at least Java 8 and a configuration file to read. In terms of hardware, the program is written to either run in sequential mode which uses the minimum about of resources or parallel mode. Parallel mode is written to automatically adjust its resource use based on available hardware.
14+
15+
One can simply check that they have Java installed by running the command `java -version` in one's terminal. Of it says something like 1.8... (or higher) then it is probably installed properly. Otherwise go install it, is a rather simple process.
16+
17+
### How to Run
18+
19+
Simply enter into a terminal `java -jar Hand_Probability_Calculator_V1_GTH_2021.jar`. The JAR can be run from anywhere, just specify its location.
20+
21+
Typically one will also specify some additional arguments, such as both "--input" and "--simulation_results_console". An explanation on them can be found in the Command Line Arguments section.
22+
23+
The format for running with arguments is `java -jar Hand_Probability_Calculator_V1_GTH_2021.jar --arguments -flags`. The combination of both flags and arguments, can be placed in any order.
1224

1325
## Command Line Arguments
1426

@@ -21,7 +33,7 @@ The lack of any of the following will result in their corresponding default valu
2133
- --verbose: is for all files relating to error logs to be created. As well as for files that shows the progress of the program.
2234
- --scenario_output_flag: outputs all scenarios in dot file format. Be careful with using this, as it creates a lot of files, about equal to all the other output files that the other flags would create, combined.
2335
- --simulation_results_console: to have the simulation results be output to console instead of in a created file.
24-
- --force_sequential: to force the program to perform the simulation sequentially rather then allowing the program to pick sequential or parallel.
36+
- --force_sequential: to force the program to perform the simulation sequentially rather than allowing the program to pick sequential or parallel.
2537

2638
### Parameters
2739

simulation/Simulation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ protected void modulate_parallelization()
499499
//10 ensures that lowest possible argument will still result in a value greater than 1.
500500
if (BLOCKING_QUEUE_SIZE > UPPER_THRESHOLD)
501501
{
502-
this.partition_count *= Math.log10(10 + BLOCKING_QUEUE_SIZE - UPPER_THRESHOLD);
502+
this.partition_count *= Math.log10(10 - UPPER_THRESHOLD + BLOCKING_QUEUE_SIZE);
503503
this.set_partition_count_related_values();
504504
}
505505
else if (LOWER_THRESHOLD > BLOCKING_QUEUE_SIZE)
@@ -542,12 +542,13 @@ protected void run_subroutine(final int START, final int END)
542542

543543
synchronized (Simulation.PARALLEL_SIMULATION_LOCK)
544544
{
545+
TASK_OVERSEER.prestartAllCoreThreads();
545546
START_TIME = System.currentTimeMillis();
546547
TASK_OVERSEER.execute(new Task_Manager(TASK_OVERSEER, HITS, this.DECK, this.FOREST));
547548

548549
try
549550
{
550-
final int MAX_DURATION = 15;
551+
final int MAX_DURATION = 10;
551552
final TimeUnit TEMPORAL_UNIT = TimeUnit.MINUTES;
552553
final String TEMPORAL_UNIT_TEXT = TEMPORAL_UNIT.name().toLowerCase();
553554
if (!TASK_OVERSEER.awaitTermination(MAX_DURATION, TEMPORAL_UNIT))

starting_point/Starting_Point.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class Starting_Point
112112
* Name of the authors of this program and where it can be downloaded from
113113
*/
114114
public final static String AUTHORS = "Created by both Gabriel Toban Harris and Alexander Oxorn. " +
115-
"Most recent releases can be found at \"https://github.com/Gabriel-T-Harris/Hand_Probability_Calculator\".";
115+
"Most recent release can be found at \"https://github.com/Gabriel-T-Harris/Hand_Probability_Calculator\".";
116116

117117
/**
118118
* Simple pattern that matches using the predefined horizontal whitespace character. Equivalent to "[ \t\xA0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000]".

structure/Evaluable.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ interface RollbackCallback {
5757
TestResult call();
5858
}
5959

60-
//TODO: add javadoc
60+
/**
61+
* Essentially acts like ifdef for sections of code.
62+
*/
6163
public final static boolean debugMode = false;
6264

6365
/**

0 commit comments

Comments
 (0)