id
stringlengths
36
36
text
stringlengths
1
1.25M
757cdc04-6f33-419f-a036-d5dc8f8fe5a2
void findMinimum() throws Exception;
af0ae64f-1076-45db-936c-55eefa0c5fea
void updateSolution(int indexSubsetOne, int indexSubsetTwo) throws Exception;
50e6cf6b-84b8-413e-acc8-7fc36fb5cc99
void pickRandomSolution();
85785333-1df9-41fd-bc74-ad1c84cc87f7
int[] getCurrentSolution() throws Exception;
d5028d8a-51c2-4df1-87f7-6dc2aed72161
Set getSubsetOne();
27bd19db-4b06-41e2-a3c0-ac004c158df3
Set getSubsetTwo();
8e0bc755-dd13-4b8e-b0e1-a3cadd19d109
int getFitnessValue();
3b357d11-8b77-4688-becb-30db9e1934cb
int[] getPossibleSolutions();
f709f52c-3f1c-4ea6-96bb-a0eecfea8b93
void printPossibleSolutions();
fa4770bd-4280-4c51-9acb-549796584c7d
@Before public void initialize() { hc = new HillClimber(parentSet); hc.defineInitialState(); setUpTestSolution(); }
c6cd9137-64a2-487e-bc0a-38e9042ae879
public void setUpTestSolution() { expectedArray[0] = 4; expectedArray[1] = 6; expectedArray[2] = 8; expectedArray[3] = 2; expectedArray[4] = 6; expectedArray[5] = 0; expectedArray[6] = 2; expectedArray[7] = 4; for (int i = 0; i < hc.getSubsetOne().getLength(); i++) { hc.getSubsetOne().replaceVal...
64652dd4-c08e-488e-b37c-6a54b788b69f
@After public void cleanUp() { hc = null; }
cfed2907-a30e-41f5-a2ae-7491a215709f
@Test public void testDefineInitialState() { assertEquals(5, hc.getSubsetOne().getLength()); }
c3a71a9f-630d-43b6-b783-2e9594ca1e1b
@Test public void testPickRandomSolution() throws Exception { assertNotNull(hc.getCurrentSolution()); }
54f44c73-4661-4f95-9ddb-560b75675166
@Test public void testGetCurrentSolution() throws Exception { assertNotNull(hc.getCurrentSolution()); }
74a2c5c2-8c50-4dc7-9ea0-37319ae230a4
@Test public void testComputeFitnessValue() throws Exception { int expectedDifference = 0; for (int i = 0; i < hc.getSubsetOne().getLength(); i++) { expectedDifference += hc.getSubsetOne().getValue(i) - hc.getSubsetTwo().getValue(i); } hc.computeFitnessValue(hc.getSubsetOne(), hc.getSubsetTwo()); ...
e9b191f5-0355-4deb-892f-69c3d3d342ec
@Test public void testUpdateSolution() throws Exception { for (int i = 0; i < hc.getSubsetOne().getLength(); i++) { hc.getSubsetOne().replaceValue(i+2, i); } for (int i = 0; i < hc.getSubsetTwo().getLength(); i++) { hc.getSubsetTwo().replaceValue(i, i); } hc.updateSolution(3, 2); assertEqua...
67c1b17d-f7ce-421a-b262-7a238bfb5a97
@Test public void testComputePossibleSolution() throws Exception { hc.computePossibleSolutions(); assertArrayEquals(expectedArray, hc.getPossibleSolutions()); }
9a0d4b7e-e2ff-4979-acf2-b5c3f27ece78
@Test public void testFindMinimum() throws Exception { hc.computePossibleSolutions(); hc.findMinimum(); assertEquals(0, hc.computeFitnessValue(hc.getSubsetOne(), hc.getSubsetTwo())); }
cf360a11-6366-4933-aab6-400c28fb9420
public SchemaGenerator(final String packageName) throws Exception { cfg = new AnnotationConfiguration(); cfg.setProperty("hibernate.hbm2ddl.auto", "create"); for (final Class<Object> clazz : getClasses(packageName)) { cfg.addAnnotatedClass(clazz); } }
c9471417-70b3-4835-9e1b-2aa5af544370
private void generate(final Dialect dialect) { cfg.setProperty("hibernate.dialect", dialect.getDialectClass()); final SchemaExport export = new SchemaExport(cfg); export.setDelimiter(";"); export.setOutputFile("ddl_" + dialect.name().toLowerCase() + ".sql"); export.execute(true...
638bea01-da59-4a8b-9571-48fd908d222c
public static void main(final String[] args) throws Exception { final SchemaGenerator gen = new SchemaGenerator("com.apeaka.mailgame.data.model"); gen.generate(Dialect.MYSQL); gen.generate(Dialect.ORACLE); gen.generate(Dialect.HSQL); }
f62ce3a7-d296-4022-ab08-cfb8f46a1786
private List<Class> getClasses(final String packageName) throws Exception { final List<Class> classes = new ArrayList<Class>(); File directory = null; try { final ClassLoader cld = Thread.currentThread().getContextClassLoader(); if (cld == null) { throw ne...
3bceda71-9592-4661-b171-1bb1f4794b03
private Dialect(final String dialectClass) { this.dialectClass = dialectClass; }
7db62a7c-25f8-40e4-80d4-adee9270b853
public String getDialectClass() { return dialectClass; }
ca10ea38-572a-44dd-ac6d-7bfb662ec23d
public static void main(final String[] args) { factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME); final EntityManager em = factory.createEntityManager(); // read the existing entries and write to console final Query q = em.createQuery("select g from Game g"); ...
716afc10-69a4-42cf-93b9-d736c35a3e4f
public PlayerRoundDetailPK() { }
72a10969-6775-4eb4-b2d3-57d20ec2c0c0
public Long getPlayerId() { return playerId; }
b7084bb0-7fdc-47e0-986b-feef8a04ee66
public void setPlayerId(final Long playerId) { this.playerId = playerId; }
1257b933-2251-487e-aaa5-5c02f415c724
public Long getRoundId() { return roundId; }
85fbc029-c5ac-4652-a4c2-fe402f142e85
public void setRoundId(final Long roundId) { this.roundId = roundId; }
f8a46f3a-19a6-4248-9091-b2991b7094f8
@Override public boolean equals(final Object other) { if (this == other) { return true; } if (!(other instanceof PlayerRoundDetailPK)) { return false; } final PlayerRoundDetailPK castOther = (PlayerRoundDetailPK) other; return (this.playerId....
750a3ad5-4db4-40d5-a34c-94db72dad0b1
@Override public int hashCode() { final int prime = 31; int hash = 17; hash = (hash * prime) + ((int) (this.playerId.longValue() ^ (this.playerId.longValue() >>> 32))); hash = (hash * prime) + ((int) (this.roundId.longValue() ^ (this.roundId.longValue() >>> 32))); return h...
d71b8b81-83f1-48ec-93e6-8762a724740b
public Player() { super(); }
e6483a2a-f3ae-4943-b132-42f7e259c4b3
public Long getId() { return id; }
a10fc50b-3853-49fa-a683-498e371eb7ce
public void setId(final Long id) { this.id = id; }
6d247c0a-b12b-48da-b6ea-e2bf28288a7f
public String getName() { return name; }
075f82d2-24b3-42c1-8622-d162c94b7d55
public void setName(final String name) { this.name = name; }
f89a059a-d28b-47c2-8f45-ee4f28d3b85b
public Game getGame() { return game; }
f8b898ac-6b4f-44e3-b88a-70bd7e58e80b
public void setGame(final Game game) { this.game = game; }
ade39657-1192-451b-8d5c-96413a7f085b
public int getSeatingOrder() { return seatingOrder; }
d8caa9b5-09c7-47ca-b27d-bf0733a081f2
public void setSeatingOrder(final int seatingOrder) { this.seatingOrder = seatingOrder; }
b3fd19f6-af99-4601-b179-061778e90e9b
public int getScore() { return score; }
5a7056b7-c4d2-4f14-bbcf-cd039e6cd29b
public void setScore(final int score) { this.score = score; }
79174caf-f709-4a48-890a-596d88816982
public Character getActive() { return active; }
da09e49e-cddb-4370-b2b1-f62fa51ccb2d
public void setActive(final Character active) { this.active = active; }
1f313ef6-028b-430c-b3ab-653d70e85a70
public Round() { super(); }
28f46ed7-97f2-4b10-ba9d-219d2ca29e46
public Long getId() { return id; }
6ab2c340-d08b-4e70-81f7-5214649d7b75
public void setId(final Long id) { this.id = id; }
9b513da2-04c4-4d2b-83a1-2f602bbff343
public Game getGame() { return game; }
4d286850-fd3b-4c17-b683-04dd5c63cc9b
public void setGame(final Game game) { this.game = game; }
2c8b03bb-4b15-482d-8a82-037d6283c889
public int getRoundNumber() { return roundNumber; }
11aeb58a-5c20-4aca-ab9d-1c700f182444
public void setRoundNumber(final int roundNumber) { this.roundNumber = roundNumber; }
cd70395b-8494-4f50-aeec-eefcd8b4c0f9
public int getDealerSeatNumber() { return dealerSeatNumber; }
8c34bdb8-87ec-41fa-800c-595fe19a5d26
public void setDealerSeatNumber(final int dealerSeatNumber) { this.dealerSeatNumber = dealerSeatNumber; }
396a7b7c-9893-4ff0-91ef-54c7c1cb7280
public int getPlayStarterSeatNumber() { return playStarterSeatNumber; }
8de9726b-0beb-4cd4-ad02-2c6a1af6e438
public void setPlayStarterSeatNumber(final int playStarterSeatNumber) { this.playStarterSeatNumber = playStarterSeatNumber; }
b87ea7cc-0536-43a5-b736-2a107f1af1f4
public Game() { super(); }
14c84243-1711-4279-8072-3153d17ed2c6
public Long getId() { return id; }
86450c61-279e-4ce1-9031-763dbcda9da1
public void setId(final Long id) { this.id = id; }
b89c27ae-94ee-40c4-972c-2a7273b345a1
public String getName() { return name; }
895898d5-b3b9-4a05-8c60-cbfdb8e37999
public void setName(final String name) { this.name = name; }
0bb0708f-e095-47e5-aa27-30c5c0426286
public String getCreatedBy() { return createdBy; }
84839a60-bf1d-41a7-80f8-9828fb162704
public void setCreatedBy(final String createdBy) { this.createdBy = createdBy; }
cc513ebb-7ecf-47d0-a991-d1b026ee960a
public Date getCreatedDate() { return createdDate; }
2aeb1ae6-0c5e-4d62-8652-105bbe0c1f66
public void setCreatedDate(final Date createdDate) { this.createdDate = createdDate; }
da89f1b2-8aae-4397-b21a-b77971360288
public int getDeckCount() { return deckCount; }
e14ad863-b6ae-411d-93bf-16a3d04dc2d3
public void setDeckCount(final int deckCount) { this.deckCount = deckCount; }
ee51afde-26fe-48b9-b0be-bd8705c01ada
public int getMaximumPoint() { return maximumPoint; }
d620a063-c9e5-47a6-8458-b9377c151785
public void setMaximumPoint(final int maximumPoint) { this.maximumPoint = maximumPoint; }
db84eaf1-a973-4bf5-be65-3c231fbf9c23
public List<Player> getPlayers() { return players; }
1482edc0-a248-41b6-8f3e-0742245cb2e5
public void setPlayers(final List<Player> players) { this.players = players; }
ac4a6121-ce11-46c8-85d8-0b355d996dbc
public List<Round> getRounds() { return rounds; }
6e2fa66c-10f4-498c-9559-46d3fb100f77
public void setRounds(final List<Round> rounds) { this.rounds = rounds; }
7af00f74-39c2-494b-978a-71863e972cd3
@Override public String toString() { return "[Game: " + this.id + "]" + " - [name: " + this.name + "]" + " - [deckCount: " + this.deckCount + "]" + " - [maxPoint: " + this.maximumPoint + "]"; }
6d9c870a-dbff-46be-b14c-c9ec9e11d4ff
public PlayerRoundDetail() { }
cf6c0c05-6acc-4852-bf62-b28b40a3ce68
public PlayerRoundDetailPK getId() { return id; }
0298ea89-0a69-4496-a89b-962d7a4841a2
public void setId(final PlayerRoundDetailPK id) { this.id = id; }
7db3dad2-865e-4e8b-af96-4b40656ed45f
public Round getRound() { return round; }
d72b7f08-434b-45fd-a799-fcd76f2caf78
public void setRound(final Round round) { this.round = round; }
381b6838-f4aa-41d2-8fdc-8f5f5717f26b
public Player getPlayer() { return player; }
dbab873d-a4d5-4ec4-9e15-77c31ebce237
public void setPlayer(final Player player) { this.player = player; }
e34aab0c-18c0-4ed5-9778-d863bbb59728
public int getScore() { return score; }
cdf3299f-06b3-43e3-aa71-18174c24d821
public void setScore(final int score) { this.score = score; }
9e2954cf-da51-4618-b4ce-47a188487fd7
public String getCard1() { return card1; }
966aa50e-2e74-4bf5-8617-0265603a18c4
public void setCard1(final String card1) { this.card1 = card1; }
1fede4f2-fcfc-4090-8f38-4a1bb69c7ffd
public String getCard2() { return card2; }
fd326a04-1e12-4e9b-8e99-77f681d42a3a
public void setCard2(final String card2) { this.card2 = card2; }
ce99b8b8-7133-4db9-8ced-da9db4b5b6f9
public String getCard3() { return card3; }
51f8a93d-9fcb-43db-94e4-9ffb1e7e28f3
public void setCard3(final String card3) { this.card3 = card3; }
c55a8355-facb-4faa-b154-81abc02d6af7
public String getCard4() { return card4; }
0dc2fe2b-1ff4-4563-adc5-4eca07a340a6
public void setCard4(final String card4) { this.card4 = card4; }
779b916b-0b68-4137-9c58-79017625f9e1
public String getCard5() { return card5; }
fd350c21-e185-4dc0-ba9c-b4b28a5f449a
public void setCard5(final String card5) { this.card5 = card5; }
19ab1a93-a771-4748-a4a8-8666bbe16032
@Override public int hashCode() { final int prime = 31; int result = 1; result = (prime * result) + ((id == null) ? 0 : id.hashCode()); return result; }
40f29b15-f26e-4206-90f4-2676c9042fa3
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof PlayerRoundDetail)) { return false; } final PlayerRoundDetail other = (PlayerRound...
0ae237b4-cd9a-4f65-afd0-7e1595500e7f
public Pikachu(String name, int hp, int def, int spc_def, int spd, int level, int exp) { super(name, hp, def, spc_def, spd, level, exp); //Pokemon Specific this.setBASE_EXP(78); this.setWEAKNESS(Type.FIGHTING); this.setType(Type.ELECTRIC); this.addNewAttack(new ThunderShock()); }
936500ba-0308-4638-941a-d45fdc25921f
public Pokemon (String name, int hp, Attack atk, int def, int spc_atk, int spc_def, int spd, int level, int exp) { ATTACKS = new ArrayList<Attack>(); addNewAttack(atk); setDEF(def); setSPC_ATK(spc_atk); setSPC_DEF(spc_def); setSPD(spd); setMAXHP(hp); setNAME(name); setLEVEL(level); setEXP(exp)...
c6c4a600-c287-4c02-b1ea-1d42564dbe7f
public Pokemon (String name, int hp, int def, int spc_def, int spd, int level, int exp) { ATTACKS = new ArrayList<Attack>(); setDEF(def); setSPC_DEF(spc_def); setSPD(spd); setMAXHP(hp); setNAME(name); setLEVEL(level); setEXP(exp); setNEXT_LEVEL_EXP(); setMAX_ATTACKS(5); }
81be2d52-6585-401f-9352-195c4c2f50a3
private void setLEVEL(int level) { if(level > 0 && level <= 100){ LEVEL = level; return; }else{ LEVEL = 5; } }