Skip to content

Commit

Permalink
Merge pull request #65 from TUDelft-CITG/feature/clean-up
Browse files Browse the repository at this point in the history
Feature/clean up
  • Loading branch information
uijl committed Jun 25, 2019
2 parents da9fb16 + 46390a7 commit 97b9196
Show file tree
Hide file tree
Showing 22 changed files with 331 additions and 1,336 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ History
=======


0.3.0 (2019-06-19)
0.3.0 (2019-06-20)
------------------

* First release to PyPI and rename to OpenClSim
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ ![License: MIT](https://img.shields.io/badge/License-MIT-informational.svg)](https://github.com/TUDelft-CITG/OpenCLSim/blob/master/LICENSE.txt)
[ ![Documentation](https://img.shields.io/badge/sphinx-documentation-informational.svg)](https://openclsim.readthedocs.io)
[ ![License: MIT](https://img.shields.io/badge/License-MIT-informational.svg)](https://github.com/TUDelft-CITG/OpenCLSim/blob/master/LICENSE.txt)
[ ![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3251546.svg)](https://doi.org/10.5281/zenodo.3251546)

[![CircleCI](https://circleci.com/gh/TUDelft-CITG/OpenCLSim.svg?style=svg&circle-token=fc95d870dc21fdf11e1ebc02f9defcd99212197a)](https://circleci.com/gh/TUDelft-CITG/OpenCLSim)
Expand All @@ -20,7 +20,7 @@ pip install openclsim

This is the preferred method to install OpenCLSim, as it will always install the most recent stable release.

If you don’t have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process.
If you don not have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process.

You can read the [documentation](https://openclsim.readthedocs.io/en/latest/installation.html) for other installation methods.

Expand Down
24 changes: 12 additions & 12 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Required Libraries

Depending on the simulation it might be required to import additional libraries. The minimal set-up of an OpenCLSim project has the following import statements:

.. code:: ipython3
.. code:: python3
# Import openclsim for the logistical components
import openclsim.model as model
Expand All @@ -36,7 +36,7 @@ Simulation Environment

OpenClSim continues on the SimPy discrete event simulation package. Some components are modified, such as the resources and container objects, but the simulation environment is pure SimPy. Starting the simulation environment can be done with the following line of code. For more information in SimPy environment please refer to the SimPy `documentation`_.

.. code:: ipython3
.. code:: python3
# Start the SimPy environment
env = simpy.Environment()
Expand All @@ -52,7 +52,7 @@ Basic Location

The code below illustrates how a basic location can be created using OpenClSim. Such a location can be used to add information on events in space, such as tracking movement events or creating paths to follow.

.. code:: ipython3
.. code:: python3
# Import the library required to add coordinates
import shapely.geometry
Expand Down Expand Up @@ -82,7 +82,7 @@ Storage Location

The code below illustrates how a location can be created that is capable of storing an amount. Such a location can be used by the OpenClSim.model activities as origin or destination.

.. code:: ipython3
.. code:: python3
# Import the library required to add coordinates
import shapely.geometry
Expand Down Expand Up @@ -116,7 +116,7 @@ Processing Storage Location

The code below illustrates how a location can be created that is capable of storing an amount. Additional to the storage location, a processing- and storage location can be used as both the origin and loader or destination and unloader in a OpenClSim.model activity.

.. code:: ipython3
.. code:: python3
# Import the library required to add coordinates
import shapely.geometry
Expand Down Expand Up @@ -164,7 +164,7 @@ Processing Resource

An example of a processing resource is a harbour crane, it processes units from a storage location to a transporting resource or vice versa. In the OpenClSim.model activity such a processing resource could be selected as the loader or unloader. The example code is presented below.

.. code:: ipython3
.. code:: python3
# Create a resource
ProcessingResource = type(
Expand Down Expand Up @@ -200,7 +200,7 @@ Transporting Resource

A harbour crane will service transporting resources. To continue with the harbour crane example, basically any vessel is a transporting resource because it is capable of moving units from location A to location B. In the OpenClSim.model activity such a processing resource could be selected as the mover.

.. code:: ipython3
.. code:: python3
# Create a resource
TransportingResource = type(
Expand Down Expand Up @@ -239,7 +239,7 @@ Transporting Processing Resource

Finally, some resources are capable of both processing and moving units. Examples are dredging vessels or container vessels with deck cranes. These specific vessels have the unique property that they can act as the loader, unloader and mover in the OpenClSim.model activity.

.. code:: ipython3
.. code:: python3
# Create a resource
TransportingProcessingResource = type(
Expand Down Expand Up @@ -285,7 +285,7 @@ Simulations

The code below will start the simulation if SimPy processes are added to the environment. These SimPy processes can be added using a combination of SimPy and OpenCLSim, or by using OpenCLSim activities.

.. code:: ipython3
.. code:: python3
env.run()
Expand All @@ -294,7 +294,7 @@ SimPy processes

A SimPy process can be initiated using the code below. The code below will instruct Resource 02, which was a TransportingResource, to sail from Location 01 (at Lat, Long (0, 0)) to Location 02 (at Lat, Long (0, 1)). The simulation will stop as soon as Resource 02 is at Location 02.

.. code:: ipython3
.. code:: python3
# Create the process function
def move_resource(mover, destination):
Expand Down Expand Up @@ -332,7 +332,7 @@ This cycle is repeated until a certain condition is met. Between the individual

If no additional input is provided, the cyclic process will be repeated until either the origin is empty or the destination is full. The example activity below will stop after two cycles because the origin will be empty and the destination will be full.

.. code:: ipython3
.. code:: python3
# Define the activity
activity_01 = model.Activity(
Expand All @@ -353,7 +353,7 @@ Conditional Activities

Additionally, start and stop events can be added to the activity. The process will only start as soon as a start event (or a list of start events) is completed and it will stop as soon as the stop event (or a list of stop events) are completed. These can be any SimPy event, such as a time-out, but OpenClSim provides some additional events as well, such as empty- or full events. The activity in the example below will start as soon as the previous activity is finished, but not sooner than 2 days after the simulation is started.

.. code:: ipython3
.. code:: python3
# Activity starts after both
# - Activity 01 is finished
Expand Down
8 changes: 5 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Open Complex Logistics Simulation
=================================
Open source Complex Logistics Simulation
========================================

OpenCLSim is a python package for rule driven scheduling of cyclic activities for in-depth comparison of alternative operating strategies

Welcome to OpenCLSim documentation! Please check the contents below for information on installation, getting started and actual example code. If you want to dive straight into the code you can check out our `GitHub`_ page or the working examples presented in `Jupyter Notebooks`_.

Expand All @@ -24,4 +26,4 @@ Indices and tables
* :ref:`search`

.. _GitHub: https://github.com/TUDelft-CITG/OpenCLSim
.. _Jupyter Notebooks: http://docs.python-guide.org/en/latest/starting/installation/
.. _Jupyter Notebooks: https://github.com/TUDelft-CITG/OpenCLSim-Notebooks
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To install OpenCLSim, run this command in your terminal:
This is the preferred method to install OpenCLSim, as it will always install the most recent stable release.

If you don't have `pip`_ installed, this `Python installation guide`_ can guide
If you do not `pip`_ installed, this `Python installation guide`_ can guide
you through the process.

.. _pip: https://pip.pypa.io
Expand Down
24 changes: 12 additions & 12 deletions docs/openclsim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@ openclsim\.model module
--------------------------

.. automodule:: openclsim.model
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

openclsim\.core module
--------------------------

.. automodule:: openclsim.core
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

openclsim\.server module
--------------------------

.. automodule:: openclsim.server
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: openclsim
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Import required components

To use OpenCLSim in a project you have to import the following three components:

.. code:: ipython3
.. code:: python3
# Import openclsim for the logistical components
import openclsim.model as model
Expand All @@ -23,7 +23,7 @@ Using Mixins and Metaclasses

The Open Complex Logistics Simulation package is developed with the goal of reusable and generic components in mind. A new class can be instatiated by combining mixins from the *openclsim.core*, such as presented below. The following lines of code demonstrate how a containervessel can be defined:

.. code:: ipython3
.. code:: python3
# Define the core components
# A generic class for an object that can move and transport material
Expand Down

0 comments on commit 97b9196

Please sign in to comment.