local_search/local_search.py
def read_schedule_file(self, fname):
		''' Expects a file with lines of the form "time:job1,job2,...".
		This function reads this file and constructs the schedule in memory.
		Then it looks at the schedule and sets to zero the capacities of timeslot-SINK edges
		that are closed in the schedule. '''

		schedule = [None for t in range(self.T)]
		with open(fname) as f:
			for line in f:
				if len(line.strip()) == 0: continue
				if line.strip().startswith("#"): continue
				tok = line.strip().split(":")
				slot_number = int(tok[0])
				slot_jobs = tok[1].split(",")
				schedule[slot_number] = slot_jobs

		for t, tval in enumerate(schedule):
			if tval == None:
				# t is closed so set the corresponding time node - SINK edge to zero capacity
				self.g.edge[t][self.SINK]['capacity'] = 0
		if not self.is_schedule_feasible():
			return False
		return True
 Expects a file with lines of the form "time:job1,job2,...".
		This function reads this file and constructs the schedule in memory.
		Then it looks at the schedule and sets to zero the capacities of timeslot-SINK edges
		that are closed in the schedule. 
Expects a file with lines of the form "time:job1,job2,...".
This function reads this file and constructs the schedule in memory.
Then it looks at the schedule and sets to zero the capacities of timeslot-SINK edges
that are closed in the schedule.
Expects a file with lines of the form " time : job1 job2 ... " . This function reads this file and constructs the schedule in memory . Then it looks at the schedule and sets to zero the capacities of timeslot - SINK edges that are closed in the schedule .
def read_schedule_file(self, fname):
		schedule = [None for t in range(self.T)]
		with open(fname) as f:
			for line in f:
				if len(line.strip()) == 0: continue
				if line.strip().startswith("#"): continue
				tok = line.strip().split(":")
				slot_number = int(tok[0])
				slot_jobs = tok[1].split(",")
				schedule[slot_number] = slot_jobs
		for t, tval in enumerate(schedule):
			if tval == None:
				self.g.edge[t][self.SINK]['capacity'] = 0
		if not self.is_schedule_feasible():
			return False
		return True
def read_schedule_file ( self , fname ) : schedule = [ None for t in range ( self . T ) ] with open ( fname ) as f : for line in f : if len ( line . strip ( ) ) == 0 : continue if line . strip ( ) . startswith ( "#" ) : continue tok = line . strip ( ) . split ( ":" ) slot_number = int ( tok [ 0 ] ) slot_jobs = tok [ 1 ] . split ( "," ) schedule [ slot_number ] = slot_jobs for t , tval in enumerate ( schedule ) : if tval == None : self . g . edge [ t ] [ self . SINK ] [ 'capacity' ] = 0 if not self . is_schedule_feasible ( ) : return False return True
Expects a file with lines of the form "time:job1,job2,...".
Expects a file with lines of the form " time : job1 job2 ... " .
''' Expects a file with lines of the form "time:job1,job2,...".
		This function reads this file and constructs the schedule in memory.
		Then it looks at the schedule and sets to zero the capacities of timeslot-SINK edges
		that are closed in the schedule. ''' # t is closed so set the corresponding time node - SINK edge to zero capacity
self
fname