gem-graph-server/src/main.py

41 lines
2.1 KiB
Python
Raw Normal View History

#=----------------------------------------------------------------------------=#
# Server interface related functions #
# #
# Copyright © 2021 The Gem-graph Project #
# #
# This file is part of gem-graph. #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Affero General Public License as #
# published by the Free Software Foundation, either version 3 of the #
# License, or (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU Affero General Public License for more details. #
# #
# You should have received a copy of the GNU Affero General Public License #
# along with this program. If not, see <https://www.gnu.org/licenses/>. #
#=----------------------------------------------------------------------------=#
import server
import scheduler
import random
ARROW_NUMBER = 150
2021-04-10 21:25:31 +02:00
MAX_CYCLES = 40000
SPACE_SIZE = 10000
PREEMPTION_GLOBAL_SPACE = [True] * SPACE_SIZE
DRAWING_GLOBAL_SPACE = []
ARROW_LIST = [(random.randint(0,SPACE_SIZE - 1),0) for x in range(ARROW_NUMBER)]
TRANSITIONS_TREE = None
MAX_THREAD = 10
masterThread = scheduler.GreatScheduler(PREEMPTION_GLOBAL_SPACE, TRANSITIONS_TREE, ARROW_LIST, MAX_THREAD, MAX_CYCLES)
masterThread.start()
server.ServerCLI.start()
## Exiting
scheduler.masterThread = True