-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build configuration and server implementation
- Add npm install and build targets for the oRatio GUI in CMakeLists.txt - Update .gitignore to include additional files - Modify server constructor to use a relative path for assets directory - Implement assets route in the server to serve static files - Enhance main function to handle multiple input files and output solution - Update submodule references for rationet and riddle
- Loading branch information
1 parent
caafb28
commit da9d396
Showing
7 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.vscode | ||
build | ||
.z3-trace | ||
build | ||
solution.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule riddle
updated
4 files
+1 −1 | extern/json | |
+1 −2 | include/core.hpp | |
+4 −4 | src/core.cpp | |
+4 −5 | src/item.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,43 @@ | ||
#include "solver_server.hpp" | ||
#include "logging.hpp" | ||
#include <thread> | ||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
if (argc < 3) | ||
{ | ||
LOG_FATAL("usage: oRatio <input-file> [<input-file> ...] <output-file>"); | ||
return -1; | ||
} | ||
|
||
// the problem files.. | ||
std::vector<std::string> prob_names; | ||
for (int i = 1; i < argc - 1; i++) | ||
prob_names.push_back(argv[i]); | ||
|
||
// the solution file.. | ||
std::string sol_name = argv[argc - 1]; | ||
|
||
LOG_INFO("starting oRatio server"); | ||
|
||
ratio::server::server server; | ||
|
||
auto srv_ft = std::async(std::launch::async, [&server] | ||
{ server.start(); }); | ||
std::this_thread::sleep_for(std::chrono::seconds(1)); | ||
server.read(prob_names); | ||
|
||
if (server.solve()) | ||
{ | ||
LOG_INFO("hurray!! we have found a solution.."); | ||
|
||
std::ofstream sol_file; | ||
sol_file.open(sol_name); | ||
sol_file << server.to_json().dump(); | ||
sol_file.close(); | ||
} | ||
else | ||
LOG_INFO("the problem is unsolvable.."); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters