Skip to content
Extraits de code Groupes Projets
Valider 6181f9b6 rédigé par Anzo's avatar Anzo
Parcourir les fichiers

first implem of rngs

parent 6f20b273
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Fichier ajouté
## Various Random Generators ##
class RandomNumberGenerator:
def __init__(self):
return NotImplementedError
def random():
"""
yield a number from the RNG
"""
return NotImplementedError
def seed():
"""
set the seed of the generator
"""
return NotImplementedError
class LCG(RandomNumberGenerator):
"""
Linear Congruential generator algorithm
"""
def __init__(self, m, c, a):
super().__init__()
self.m = m
self.c = c
self.a = a
self.x = 0 #default seed
def random():
self.x = self.a * self.x + self.c % self.m
def seed(self, seed):
self.x = seed
%%%%%%%%%%%%%%%%%%%%%%%%%%% PACKAGES AND CONFIGS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%article in english
\documentclass[a4paper,12pt] {article}
\usepackage[english] {babel}
%\usepackage[utf8]{inputenc} %we use xelatex
%bibliography
\usepackage{biblatex}
\addbibresource{bibliography.bib}
%Images
\usepackage{float}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{url}
%Nice linkss
\usepackage{hyperref}
\hypersetup
{
pdftitle = {output}, %TODO CHANGE ME !!
colorlinks = false,
hidelinks = true
}
%tabular stuff
\usepackage{array}
\usepackage{tabularx}
%linespace
\usepackage{setspace}
%asbtract paging
%\usepackage{abstract}
%comments
\usepackage{comment}
%font and geometry settings
\usepackage[T1]{fontenc}
\usepackage{fontspec-xetex}
\usepackage{inconsolata}
\setmonofont{inconsolata}
\usepackage[top=2cm, bottom=2.5cm, left=2.5cm, right=2.5cm] {geometry}\pagestyle{plain}
%image gallery
%\usepackage{subfig}
%footnote stuff
%\usepackage[bottom] {footmisc}
%pdf inclusion
%\usepackage{pdfpages}
%resize sections, subsections...
%watermark
%\usepackage{draftwatermark}
%footnote numbe
%\usepackage{perpage}
%Code !
\usepackage{minted}
\usemintedstyle{trac}
\newmintedfile[cppfile]{cpp}
{
framesep=1mm,
baselinestretch=1,
fontsize=\small,
bgcolor=pink!20,
%frame=single,
linenos
}
\usepackage[utf8]{inputenc}
\usepackage{verbatim}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DOCUMENT STARTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%% Misc intro content %%%%%%%%
\newpage
\thispagestyle{empty} % no page numerotation
\input{cover_page.tex}
\newpage
\thispagestyle{empty}
\input{thanks.tex}
\newpage
\thispagestyle{empty}
\input{summary_and_keywords.tex}
\newpage
\thispagestyle{empty}
\input{abbrevations.tex}
% \newpage
% \thispagestyle{empty}
% \input{LLNL_presentation.tex}
%table of content
\newpage
\thispagestyle{empty}
\tableofcontents
\newpage
%%%%%%% Main content %%%%%%%%
\setcounter{page}{1}
\input{introduction.tex}
\clearpage
\newpage
\input{development.tex}
\clearpage
\newpage
\input{conclusion.tex}
\clearpage
%%%%%%% Appendix %%%%%%%%
\appendix
\newpage
\addcontentsline{toc}{section}{Appendices}
\section*{Appendices}
\input{DDRS.tex}
\newpage
\thispagestyle{empty}
\printbibliography
\end{document}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter