AnyLogic 9
Expand
Font size

Phase 1. Drawing a rail yard

Our model will simulate how the cars are taken to a track, sometimes called a lead or a drill. From there the cars are sent through a series of switches, called a ladder, to the classification tracks.

We want to start with the rail network of this topology:

To create a new model

  1. Log in to AnyLogic Cloud at https://cloud.anylogic.com.
  2. Click the My models tab to open the page containing your models.
  3. Now click the add New model tile to open the Create new model dialog box.

    AnyLogic Cloud: The New Model tile

  4. In the opened Create new model dialog box specify the name of the new model: Hump Yard.

    AnyLogic Cloud: The Create new model dialog box

  5. Finally, click Create.
  6. In the Models view, locate your newly created model and click it.
  7. The model properties will appear on the right. There, in the Model time section, set the Model time units: minutes.

Typical rail models use a scale of 2 pixels per meter. Since this is not the default value, it is best to set the correct scale before continuing with the model.

To set the model scale

  1. Locate the Scale element on the  Main diagram. By default, it is placed above the coordinate origin, so you might need to scroll upward slightly.
  2. Click the Scale element to see its properties in the panel on the right.
  3. Set the properties to the following:
    Scale is: Specified explicitly
    Scale: 2 pixels per meters

Now your model is set up correctly, and the scale of trains and tracks will be rendered as expected. We can start with the topology of the rail yard by drawing the railway tracks.

Let us start with a linear track.

To draw a linear railway track

  1. Click the  Railway Track element in the  Rail palette.
  2. Click in the  Main diagram to start drawing the track.
  3. Double-click where you want to place the end point of the track to finish drawing.

In the track properties, enter the Name: trackEntry. Trains will appear on this track. We will give meaningful names only to the tracks that will be referenced by the flowchart blocks. Other tracks can keep their default names.

The drawn linear track will be used by our train. Let us draw the bypass track that will be used by the locomotive to approach the train from behind to further move it to the hump yard. This track will have a curved shape and its drawing scenario will be different from the one you have followed so far.

To draw a curved bypass track

  1. Click the  Railway Track element in the  Rail palette.
  2. Then, click the point on the existing track to begin drawing the bypass track. The circle representing a switch will appear automatically.
  3. Draw more track segments to get the track shape as shown on the figure below. To add a curved segment, press the left mouse button at the point where the curved segment ends and then move the mouse with the button being pressed. As you drag the mouse, you will see the radius of the curve change. When you are finished, release the mouse button.

  4. Double-click to finish drawing the track. You cannot place the end point on the same track where you started drawing ( trackEntry), so double-click near  trackEntry.
  5. Drag the track end point onto  trackEntry to create another switch.

To adjust the curved railway track

  1. Right-click the track you want to edit.
  2. Select Show guiding lines from the context menu.
  3. Drag any circle point that lies along the track to move it and reposition the adjacent track segments.
  4. Drag a diamond-shaped handle at the end of the dashed guiding line to change the radius of the curved segment.

Railway switches

  • The railroad network consists of tracks and switches. Railway switches appear automatically in the shape of a circle when you connect a branch track to an existing railway track. You cannot connect more branch tracks to the same point.
  • At each switch, there must be at least two obtuse angles out of three between the ends of the track. The switch determines the routes based on these angles.

To modify the rail yard

The lead track will be divided into tracks each time we create railway switches on it. In our case, we created two switches by connecting a bypass track in two points of the existing track. As a result, the lead track is divided into three tracks with their own names and properties.

Now we will give a meaningful name to the track between the switches and add Position on track shapes to our rail yard.

  1. Name this track trackArrival, as this is the track where the train arrives.
  2. Drag the  Position on track element from the Rail Library palette and place it as shown on picture below. Name it stopLineEntry. It will define the place where trains appear.
  3. Add  Position on track: stopLineArrival. The train will stop at this point to release the locomotive so that it can continue on its own.
  4. Add  Position on track: stopLineHump. This is where the cars are sorted by type.

Position on track

Position on track is a space markup shape that is used to define the exact position on the railway track. This is needed when you define:

  • The position on the track where the train will appear.
  • The position where the train will stop.

In this phase of the Hump Yard tutorial we have created a rail yard.

There are several reference models available that represent the milestones of the process. You can use them if you are having trouble creating a model and want to compare your model to the reference file. Below is the link that to open the reference model corresponding to this phase.
Demo model: Hump Yard - Phase 1 Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files). Demo model: Hump Yard - Phase 1Open the model in your AnyLogic desktop installation.
How can we improve this article?