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
package main | |
func main() { | |
counter := 0 | |
for { | |
counter++ | |
} | |
} |
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
import random | |
# Define the number of jobs and their processing times | |
NUM_JOBS = 5 | |
processing_times = [10, 6, 8, 7, 3] # Example processing times for each job | |
# Genetic Algorithm parameters | |
POPULATION_SIZE = 50 | |
NUM_GENERATIONS = 100 | |
CROSSOVER_RATE = 0.8 |
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
import math | |
import threading | |
import tkinter as tk | |
import numpy as np | |
from numpy import random | |
class TravelingSalesmanProblem: | |
def __init__(self, num_cities): | |
# Define the number of cities |
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
import random | |
import numpy as np | |
# Define the distance matrix between cities | |
# In this example, we generate random distances for demonstration purposes | |
def generate_distance_matrix(num_cities): | |
distances = np.random.randint(10, 100, size=(num_cities, num_cities)) | |
np.fill_diagonal(distances, 0) # Diagonal elements are zero | |
return distances |