Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pingouins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felton Samuel
pingouins
Commits
557ced61
Commit
557ced61
authored
8 years ago
by
Bariatti Francesco
Browse files
Options
Downloads
Patches
Plain Diff
New version of Makefile: changed name of the output, added comments and improved rules
parent
b0752b27
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+29
-17
29 additions, 17 deletions
Makefile
gui/src/controller/Controller.java
+1
-1
1 addition, 1 deletion
gui/src/controller/Controller.java
src/main/main.cpp
+1
-16
1 addition, 16 deletions
src/main/main.cpp
with
31 additions
and
34 deletions
Makefile
+
29
−
17
View file @
557ced61
# Compiler
CC
=
g++
CC
=
g++
# Output directory
BIN
=
bin
BIN
=
bin
INCLUDE
=
-I
src/game
-I
src/util
-I
src/monte_carlo
-I
src/mcts
-I
src/minmax
-I
src/json
# Name of the executable
CFLAGS
=
-g
-O3
-ffast-math
-fopenmp
-c
-Wall
-std
=
c++11
$(
INCLUDE
)
EXECUTABLE
=
$(
BIN
)
/penguin
# Directories with .h files
INCLUDE
=
-I
src/game
-I
src/util
-I
src/monte_carlo
-I
src/mcts
-I
src/json
# Directories in which make will search for files
vpath
%.cpp
src/game
src/main
src/util
src/monte_carlo
src/mcts
src/gdl
# Flags passed to the compiler
CFLAGS
=
-g
-O3
-ffast-math
-fopenmp
-Wall
-std
=
c++11
# Flags passed to the linker
LDFLAGS
=
-fopenmp
-std
=
c++11
#-lprofiler -Wl,-no_pie
LDFLAGS
=
-fopenmp
-std
=
c++11
#-lprofiler -Wl,-no_pie
SOURCES
=
omp_util.cpp fast_log.cpp display_node.cpp penguin.cpp connect4.cpp morpion.cpp test_two_players_game.cpp test_connect4.cpp monte_carlo.cpp test_monte_carlo.cpp test_fast_log.cpp
\
# Cpp source files
statistics.cpp node.cpp allocator.cpp test_allocator.cpp openings.cpp mcts_two_players.cpp test_mcts_two_players.cpp test_minmax.cpp
\
SOURCES
=
omp_util.cpp fast_log.cpp display_node.cpp penguin.cpp test_two_players_game.cpp monte_carlo.cpp
\
bits.cpp test_bits.cpp main.cpp
test_fast_log.cpp statistics.cpp node.cpp allocator.cpp test_allocator.cpp openings.cpp mcts_two_players.cpp
\
test_mcts_two_players.cpp bits.cpp test_bits.cpp main.cpp
# Generating .o files' names
OBJECTS
=
$(
addprefix
$(
BIN
)
/,
$(
SOURCES:.cpp
=
.o
))
OBJECTS
=
$(
addprefix
$(
BIN
)
/,
$(
SOURCES:.cpp
=
.o
))
EXECUTABLE
=
$(
BIN
)
/theturk
vpath %.cpp src/game
:
src/main:src/util:src/monte_carlo:src/mcts:src/gdl:src/minmax
all
:
$(EXECUTABLE)
# ========= RULES ============
# Creates the output directory and the executable
all
:
bindir $(EXECUTABLE)
# Creates the output directory if it doesn't exist
bindir
:
mkdir
-p
$(
BIN
)
$(EXECUTABLE)
:
$(OBJECTS)
$(EXECUTABLE)
:
$(OBJECTS)
$(
CC
)
$(
LDFLAGS
)
$(
OBJECTS
)
-o
$@
$(
CC
)
$(
LDFLAGS
)
$(
OBJECTS
)
-o
$@
-include
$(BIN)/$(OBJECTS:.o=.d)
# Creates .o files with automatic generation of dependencies (.d) files
$(BIN)/%.o
:
%.cpp
$(BIN)/%.o
:
%.cpp
$(
CC
)
-c
$(
CFLAGS
)
$<
-o
$(
BIN
)
/
$*
.o
$(
CC
)
-c
$(
CFLAGS
)
$(
INCLUDE
)
-MD
-MP
$<
-o
$@
$(
CC
)
-MM
$(
CFLAGS
)
$<
>
$(
BIN
)
/
$*
.d
# Include the dependency files into the makefile
@
mv
-f
$(
BIN
)
/
$*
.d
$(
BIN
)
/
$*
.d.tmp
-include
$(OBJECTS:.o=.d)
@
sed
-e
's|.*:|
$(
BIN
)
/$*.o:|'
<
$(
BIN
)
/
$*
.d.tmp
>
$(
BIN
)
/
$*
.d
@
sed
-e
's/.*://'
-e
's/\\$$//'
<
$(
BIN
)
/
$*
.d.tmp |
fmt
-1
|
\
sed
-e
's/^ *//'
-e
's/$$/:/'
>>
$(
BIN
)
/
$*
.d
@
rm
-f
$(
BIN
)
/
$*
.d.tmp
# Deletes .o, .d and the executable
clean
:
clean
:
rm
-f
$(
BIN
)
/
*
.o
$(
BIN
)
/
*
.d
$(
EXECUTABLE
)
rm
-f
$(
BIN
)
/
*
.o
$(
BIN
)
/
*
.d
$(
EXECUTABLE
)
This diff is collapsed.
Click to expand it.
gui/src/controller/Controller.java
+
1
−
1
View file @
557ced61
...
@@ -30,7 +30,7 @@ import java.util.ResourceBundle;
...
@@ -30,7 +30,7 @@ import java.util.ResourceBundle;
public
class
Controller
implements
Initializable
public
class
Controller
implements
Initializable
{
{
private
static
final
String
iaProgramPath
=
"../bin/
theturk
"
;
private
static
final
String
iaProgramPath
=
"../bin/
penguin
"
;
private
static
final
String
introMusicFile
=
"./resource/pingu_theme.wav"
;
private
static
final
String
introMusicFile
=
"./resource/pingu_theme.wav"
;
private
static
final
String
clickSoundFile
=
"./resource/clic.wav"
;
private
static
final
String
clickSoundFile
=
"./resource/clic.wav"
;
private
static
final
int
max1Fish
=
30
,
max2Fish
=
20
,
max3Fish
=
10
;
private
static
final
int
max1Fish
=
30
,
max2Fish
=
20
,
max3Fish
=
10
;
...
...
This diff is collapsed.
Click to expand it.
src/main/main.cpp
+
1
−
16
View file @
557ced61
#include
"test_connect4.hpp"
#include
"connect4.hpp"
#include
"morpion.hpp"
#include
"penguin.hpp"
#include
"penguin.hpp"
#include
"test_two_players_game.hpp"
#include
"test_two_players_game.hpp"
#include
"test_monte_carlo.hpp"
#include
"test_fast_log.hpp"
#include
"test_fast_log.hpp"
#include
"test_allocator.hpp"
#include
"test_allocator.hpp"
#include
"test_mcts_two_players.hpp"
#include
"test_mcts_two_players.hpp"
#include
"test_minmax.hpp"
#include
"test_bits.hpp"
#include
"test_bits.hpp"
#include
"learning.hpp"
#include
"learning.hpp"
...
@@ -17,23 +12,13 @@ using namespace std;
...
@@ -17,23 +12,13 @@ using namespace std;
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
// game::test_connect4();
// util::test_fast_log(100000000);
// util::test_fast_log(100000000);
// mcts::test_allocator(10, 2);
// mcts::test_allocator(10, 2);
// omp_set_num_threads(8);
// omp_set_num_threads(8);
// game::run_test_two_players_game(game::connect4());
//mcts::run_test_mcts_two_players(game::connect4());
//game::run_test_two_players_game(game::morpion());
//mcts::run_test_mcts_two_players(game::morpion());
//game::run_test_two_players_game(game::penguin());
//game::run_test_two_players_game(game::penguin());
mcts
::
run_test_mcts_two_players
(
game
::
penguin
());
mcts
::
run_test_mcts_two_players
(
game
::
penguin
());
// minmax::test_minmax();
//util::test_bits(200000000);
//util::test_bits(200000000);
//game::connect4 c4;
// util::learning::display_file(c4, "learning_examples.txt");
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment