Skip to content
Snippets Groups Projects
Commit d8499682 authored by Wahab's avatar Wahab
Browse files

changed main back and added runaco3d.cpp

parent 18981820
Branches feature/ACO_Implementation
No related tags found
1 merge request!24Feature: Added ACO and made some GUI changes
......@@ -32,7 +32,8 @@ set(SOURCE_FILES main.cpp
src/strategies/cache/FileCacheManager.cpp
src/strategies/cache/FileCacheManager.h
src/strategies/cache/LongTermCacheData.cpp
src/strategies/cache/LongTermCacheData.h)
src/strategies/cache/LongTermCacheData.h
RunAco3D.cpp)
add_executable(main_run ${SOURCE_FILES})
......
#include <iostream>
#include <string>
#include "ACO3D.h"
#include "Application.h"
int main(){
// Example HP sequence
std::string hpSeq = "hphhpphhhhphhhpphhpphphhphphhpphhppphpppppppphh";
// Set up ACO parameters
ACOParams params;
params.numAnts = 100;
params.maxIterations = 100;
params.alpha = 1.0;
params.beta = 2.0;
params.rho = 0.3;
params.pheromoneInit = 1.0;
params.stagnationThreshold = 10.0;
params.theta = 0.1;
// For local search
params.macroMutationAttempts = 1;
params.pointMutationAttempts = 1;
params.localSearchMaxNoImprove = 5;
params.mutationRetentionProb = 0.7;
params.gamma = 1.0;
// Build the solver
ACO3D solver(hpSeq, params);
// Solve
BestSolution best = solver.solve();
if(best.valid){
std::cout << "Best Score Found: " << best.score << std::endl;
// Or JSON:
std::cout << best.model.pointsToJson() << std::endl;
} else {
std::cout << "No valid conformation found!\n";
}
// Test
return 0;
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment