Ana Nelson | 13 Nov 13:01
Picon
Gravatar

Running SimPy on an EC2 instance or a Virtual Machine

I've written up a tutorial relating to running simulations or other
batch processes on a virtual machine (using Parallels) or on an Amazon
Elastic Compute Cloud (EC2) instance. My original goal was to have
extra computing power (in the form of an EC2 instance) available to me
when I needed it for simulation runs which take a lot of CPU (I don't
mean SimPy). However, I also found as I was working that this could be
a useful technique if you want to create a reproducible environment
for tutorials or troubleshooting.

I used SimPy for my examples, since my own simulation framework (it's
not discrete event simulation) isn't quite ready for publication;
SimPy was convenient and I had played around with it briefly before.

http://ananelson.com/blog/2009/11/simulations-in-the-cloud/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Siphamandla Nxumalo | 14 Nov 00:34
Picon

SymPy installation

Hi
 
I am trying to install SimPy on my notebook (windows xp), but I`m struggling. I have Python installed, I am trying to follow the read_me_first steps provided, but I cant go past step 3. Anyone who can give a clear explanation of step 3.
 
kind regards
S`pha

--
Siphamandla Lindelani Nxumalo
MSc Student
Department of Computer Science
University of Zululand
Cell: (+27) 723277418
 
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
Stefan Scherfke | 14 Nov 09:07
Picon

Re: SymPy installation

Hi,

just make sure, you’re in the same directory as the Read_me_first (and the setup.py),
then type

	python setup.py install

to tell python to use the setup.py in the current directory to install SimPy … ;-)

regards
stefan

Am 2009-11-14 um 00:34 schrieb  Nxumalo:

> Hi
>  
> I am trying to install SimPy on my notebook (windows xp), but I`m struggling. I have Python installed, I am
trying to follow the read_me_first steps provided, but I cant go past step 3. Anyone who can give a clear
explanation of step 3.
>  
> kind regards
> S`pha
> 
> -- 
> Siphamandla Lindelani Nxumalo
> MSc Student
> Department of Computer Science
> University of Zululand
> Cell: (+27) 723277418
>  
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july_______________________________________________
> Simpy-users mailing list
> Simpy-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/simpy-users

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Bonnie Douglas | 16 Nov 06:46

SimGUI with a lot of parameters

I was wondering if anyone has used SimGUI with a lot (I have 60) of parameters.
 I can only display about 44 in the Parameters window at a time and there is no
scroll bar.  If you have figured out how to display more than 40 or so
parameters I'm very interested in your solution.
Kind Regards,
Bonnie Douglas

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Klaus G. Muller | 16 Nov 14:37
Picon
Picon
Favicon

Re: SimGUI with a lot of parameters

Bonnie,
the first measure is to create a SimGUI window which uses the full 
height of the screen, but I think you have done that already..

The second measure is to create multiple "Edit" menu entries (with 
different labels, of course).
 Let us take the SimGUI.py script itself as an example:

At line 69, insert multiple menu item commands, like so:

        self.makeEdit1Menu()
        self.makeEdit2Menu()

etc.
After line 87, insert multiple menu methods, like so:

    def makeEdit1Menu(self):
        self.edit1 = Menu(self.top)
        self.edit1.add_command(label = 'Change parameters',
                              command = self.changeParameters1, 
underline = 0)
        self.edit1.add_command(label = 'Clear console',
                              command = self.clearConsole, underline = 1)
        self.top.add_cascade(label = 'Edit1',
                        menu = self.edit1, underline = 0)

    def makeEdit2Menu(self):
        self.edit2 = Menu(self.top)
        self.edit2.add_command(label = 'Change parameters',
                              command = self.changeParameters2, 
underline = 0)
        self.edit2.add_command(label = 'Clear console',
                              command = self.clearConsole, underline = 1)
        self.top.add_cascade(label = 'Edit2',
                        menu = self.edit2, underline = 0)

etc.

All that remains is to partition the parameters into subsets which are 
not too long to be shown in the window. Say there are three subsets, like:

Subset 1:
"first par"
. . . .
. . . .
"last par of this subset"

Subset 2:
"one par"
. . . .
. . . .
"another par"

Subset 3:
"yet another par"
. . . .
. . . .
"and another par"

Obviously, you have to pick the real names from the list returned by 
self._parameters.__dict__.keys(). The edit boxes are generated in 
lexical order of the parameter names.

Change changeParameters (l. 227) as follows:

    def changeParameters(self):
        """Offers first subset of entry fields for parameter change"""

        self.findParameters()
        if not self._parameters:
            showwarning('SimGUI warning', 'No Parameters instance found.')
            return
        t1 = Toplevel(self.root)
        top = Frame(t1)
        self.lbl={}
        self.ent={}
        i = 1
        parKey={"start":"first par","end":"last par of this subset"
        adding = False
        done = False
        for p in self._parameters.__dict__.keys():
             if done:
                   break
             if not adding:
                   continue
             if p == parKey["start"]:
                   adding =True
             if p == parKey["end"]:
                    done = True
             self.lbl[p] = Label(top, text = p)
             self.lbl[p].grid(row = i, column = 0)
             self.ent[p] = Entry(top)
             self.ent[p].grid(row = i, column = 1)
             self.ent[p].insert(0, self._parameters.__dict__[p])
              i += 1
        top.pack(side = TOP, fill = BOTH, expand = YES)
        commitBut = Button(top, text = 'Change parameters', command = 
self.commit)
        commitBut.grid(row = i, column = 1)

At line 249 insert multiple change parameter methods, like so:

    def changeParameters1(self):
        """Offers a subset of entry fields for parameter change"""

        self.findParameters()
        if not self._parameters:
            showwarning('SimGUI warning', 'No Parameters instance found.')
            return
        t1 = Toplevel(self.root)
        top = Frame(t1)
        self.lbl={}
        self.ent={}
        i = 1
        parKey={"start":"one par","end":"another par"}
        adding = False
        done = False
        for p in self._parameters.__dict__.keys():
             if done:
                   break
             if not adding:
                   continue
             if p == parKey["start"]:
                   adding =True
             if p == parKey["end"]:
                    done = True
             self.lbl[p] = Label(top, text = p)
             self.lbl[p].grid(row = i, column = 0)
             self.ent[p] = Entry(top)
             self.ent[p].grid(row = i, column = 1)
             self.ent[p].insert(0, self._parameters.__dict__[p])
              i += 1
        top.pack(side = TOP, fill = BOTH, expand = YES)
        commitBut = Button(top, text = 'Change parameters', command = 
self.commit)
        commitBut.grid(row = i, column = 1)

    def changeParameters2(self):
        """Offers a subset of entry fields for parameter change"""

        self.findParameters()
        if not self._parameters:
            showwarning('SimGUI warning', 'No Parameters instance found.')
            return
        t1 = Toplevel(self.root)
        top = Frame(t1)
        self.lbl={}
        self.ent={}
        i = 1
        parKey={"start":"yet another par","end":"and another par"}
        adding = False
        done = False
        for p in self._parameters.__dict__.keys():
             if done:
                   break
             if not adding:
                   continue
             if p == parKey["start"]:
                   adding =True
             if p == parKey["end"]:
                    done = True
             self.lbl[p] = Label(top, text = p)
             self.lbl[p].grid(row = i, column = 0)
             self.ent[p] = Entry(top)
             self.ent[p].grid(row = i, column = 1)
             self.ent[p].insert(0, self._parameters.__dict__[p])
              i += 1
        top.pack(side = TOP, fill = BOTH, expand = YES)
        commitBut = Button(top, text = 'Change parameters', command = 
self.commit)
        commitBut.grid(row = i, column = 1)

Now, I did not test this code, but something like this should solve your 
problem of "parameter glut".

Let me know how it worked out, ok?

Klaus müller

Bonnie Douglas wrote:
> I was wondering if anyone has used SimGUI with a lot (I have 60) of parameters.
>  I can only display about 44 in the Parameters window at a time and there is no
> scroll bar.  If you have figured out how to display more than 40 or so
> parameters I'm very interested in your solution.
> Kind Regards,
> Bonnie Douglas
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simpy-users mailing list
> Simpy-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/simpy-users
>   

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Bonnie Douglas | 19 Nov 23:33

Re: SimGUI with a lot of parameters

Thank you again, Klaus.  I will implement this in the next release as it seems a
bit involved and I've run out of time.  I've implemented parameters in a .csv
file which I read in.  I also have a problem with the width of the fields in the
parameters window.  Some of my parameters are filenames which are much longer
than the field.  But I assume that I need to get into the simGUI code to modify
this.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Klaus G. Muller | 20 Nov 11:43
Picon
Picon
Favicon

Re: SimGUI with a lot of parameters

Bonnie,
with such a long list of parameters, I don't think that the GUI approach 
is the best. Have you considered  ConfigParser 
(http://docs.python.org/library/configparser.html)?

I will try to make the SimGUI edit fields larger and allow e.g. 
cascading menus in some future version.

Klaus Müller

Bonnie Douglas wrote:
> Thank you again, Klaus.  I will implement this in the next release as it seems a
> bit involved and I've run out of time.  I've implemented parameters in a .csv
> file which I read in.  I also have a problem with the width of the fields in the
> parameters window.  Some of my parameters are filenames which are much longer
> than the field.  But I assume that I need to get into the simGUI code to modify
> this.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simpy-users mailing list
> Simpy-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/simpy-users
>   

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Ram Rachum | 23 Nov 16:41
Gravatar

A different simulation framework

Hello all,

My name is Ram Rachum. For the past 6 months I've been working on my own
framework for simulations. I would appreciate if you'd check it out, and tell me 
your opinion, and how it differs from SimPy. Before I started my project I was 
aware of SimPy and read a little about it, but didn't really get what the basic 
principles of SimPy were.

The project's name is GarlicSim. Check it out here:

http://garlicsim.org

There's a short video, a readme, and a longer introduction.

I just made the first alpha release last week. I'd be happy to hear any sort of 
feedback, and if anyone is interested in trying to use it, I'll be available to 
help out.

Ram.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
Rayene Ben Rayana | 25 Nov 14:26
Picon
Gravatar

Gathering SimulationRT, SimulationStep and SimulationTrace into the same Class

Hi everybody,


I am developing a network simulator/emulator using Simpy. Simpy is a great tool, I really like its simplicity.
However, I am faced with a small issue : My simulator has a graphical user interface and I would like to switch from 'Real_time mode' to 'Step mode' to 'Simulation_time Mode' dynamically during the simulation (i.e., Pause, Step, Play Real Time, Play Simulation Time).

To do that I am willing to combine SimulationRT and SimuationStep to create a new class. Not the best thing to do IMHO, I would not take profit from the updates of these classes.

I was wondering if it is not more interesting for SimPy to have a single class "Simulation"  that gathers all the others and gives the users the possibility to change the mode dynamically.

For example:

Simulation.startStepping   => pause and switch to Step Mode
Simulation.startEmulation => Resume and switch to real time mode
Simulation.startSimulation =>Resume and switch to simulation mode 
Simulation.startTrace      => switch to trace mode 

PS: SimulationRT, SimulationTrace and SimulationStep may be kept as stub classes for backward compatibility.

Rayene,
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simpy-users mailing list
Simpy-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simpy-users
Ontje Lünsdorf | 25 Nov 16:14
Picon
Picon

Re: Gathering SimulationRT, SimulationStep and SimulationTrace into the same Class

Hi Rayene,

Am Mittwoch 25 November 2009 14:26:53 schrieb Rayene Ben Rayana:
> To do that I am willing to combine SimulationRT and SimuationStep to create
> a new class. Not the best thing to do IMHO, I would not take profit from
>  the updates of these classes.
Please wait before starting this because I just send a patch to this list for 
review. I think you should have look at it because it may allow you to do what 
you want to do.

I added a step function which will just process one event of the simulation 
and then returns. This should give your application the possibility to control 
the simulation mode. For example the simulate() method looks like this in the 
patch:

while self.is_active() and self.peek() <= until:
      self.step()

Instead of using simulate your application could call step() itself.

The message with the patch is not yet on the list because it awaits 
moderation. The patch is too large ;)

Regards,
Ontje Lünsdorf

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

Gmane