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 copy | |
alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') | |
scrambled_alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') | |
random.seed(0) | |
random.shuffle(scrambled_alphabet) | |
original_rotor1 = [(s, a) for a, s in zip(alphabet, scrambled_alphabet)] | |
random.shuffle(scrambled_alphabet) | |
original_rotor2 = [(s, a) for a, s in zip(alphabet, scrambled_alphabet)] |
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
print('this is a test') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Create a new Simulation class that inherits from the ciw.Simulation | |
# class. Has all the attributes and methods of the original class, but | |
# we can add a new method, "simulate_until_max_customers". | |
class Simulation(ciw.Simulation): | |
def simulate_until_max_customers(self, max_customers): | |
""" | |
Runs the simulation until max_customers have finished reached the Exit Node. | |
""" | |
self.nodes[0].update_next_event_date() |
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
from __future__ import division | |
import matplotlib.pyplot as plt | |
import matplotlib.gridspec as gridspec | |
import random | |
import math | |
def lognormal_cdf(x, m, s): | |
x1 = x[0] | |
x2 = x[1] | |
inner1 = (math.log(x1) - m)/(s*math.sqrt(2)) |