<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Frepple / Location </title> <link rel='stylesheet' href='../styles.css' type='text/css' /> <!--PageHeaderFmt--> </head> <body> <div id="container"> <div id="menubar"> <div id="logo" align="center"> <br/><img src='../frepple.bmp' alt="frepple" /><br/> <a href='http://www.frepple.com/'> <strong>a Free<br/>Production Planning<br/>Library</strong> </a></div> <div id="menu"> <br/> <h3><a href='../Main/HomePage.html'>Main</a></h3> <h3><a href='../UI/Main.html'>User Manual</a></h3> <h3><a href='../Tutorial/Main.html'>Tutorial</a></h3> <h3><a href='Main.html'>Reference Manual</a></h3> <h3><a href='../Main/FAQ.html'>FAQ</a></h3> <h3><a href='../reference/index.html'>C++ API</a></h3> <br/><div> </div> </div> </div> <div id="content"> <br/> <!--PageText--> <div id='wikitext'> <p><a class='wikilink' href='../Main/HomePage.html'>Main</a> > <span class='wikitrail'><a class='wikilink' href='Main.html'>Reference Manual</a> > <a class='wikilink' href='Modeling.html'>Modeling</a> > <a class='selflink' href='ModelingLocation.html'>Location</a></span> </p> <p class='vspace'>A location is a (physical or logical) place where resources, buffers and operations are located. </p> <p class='vspace'>FrePPLe uses locations from reporting purposes, and the 'available' calendar is used to model the working hours and holidays of resources, buffers and operations. </p> <div class='vspace'></div><h2>Fields</h2> <table border='1' width='100%' ><tr><td width='20%' valign='top'><strong>Field</strong> </td><td width='20%' valign='top'><strong>Type</strong> </td><td width='60%' valign='top'><strong>Description</strong> </td></tr><tr><td valign='top'>name </td><td valign='top'>non-empty string </td><td valign='top'> <p>Name of the location.<br />This is the key field and a required attribute. </p></td></tr><tr><td valign='top'>description </td><td valign='top'>string </td><td valign='top'> <p>Free format description. </p></td></tr><tr><td valign='top'>category </td><td valign='top'>normalizedString </td><td valign='top'> <p>Free format category. </p></td></tr><tr><td valign='top'>subcategory </td><td valign='top'>normalizedString </td><td valign='top'> <p>Free format subcategory. </p></td></tr><tr><td valign='top'>available </td><td valign='top'>calendar_boolean </td><td valign='top'> <p>A calendar that defines the working hours and holidays for the location.<br />All operations, buffers and resources at this location will use it. </p></td></tr><tr><td valign='top'>owner </td><td valign='top'>location </td><td valign='top'> <p>Locations are organized in a hierarchical tree.<br />This field defines the parent location. </p></td></tr><tr><td valign='top'>members </td><td valign='top'>list of location </td><td valign='top'> <p>Locations are organized in a hierarchical tree.<br />This field defines a list of child locations. </p></td></tr><tr><td valign='top'>hidden </td><td valign='top'>boolean </td><td valign='top'> <p>Marks entities that are considered hidden and are normally not shown to the end user. </p></td></tr><tr><td valign='top'>action </td><td valign='top'>A<br />C<br />AC (default)<br />R </td><td valign='top'> <p>Type of action to be executed: </p><ul><li>A: Add an new entity, and report an error if the entity already exists. </li><li>C: Change an existing entity, and report an error if the entity doesn't exist yet. </li><li>AC: Change an entity or create a new one if it doesn't exist yet. </li><li>R: Remove an entity, and report an error if the entity doesn't exist. </li></ul></td></tr></table> <div class='vspace'></div><h2>Example XML structures</h2> <ul><li>Adding or changing a location </li></ul><pre> <plan> <locations> <location name="site A"> <category>cat A</category> <owner name="Manufacturing sites"/> </location> </locations> </plan> </pre><div class='vspace'></div><ul><li>Alternate format of the previous example </li></ul><pre> <plan> <locations> <location name="Manufacturing sites"> <members> <location name="site A" category="cat A"/> </members> </location> </locations> </plan> </pre><div class='vspace'></div><ul><li>Deleting a location </li></ul><pre> <plan> <locations> <location name="site A" action="R"/> </locations> </plan> </pre><div class='vspace'></div><h2>Example Python code</h2> <ul><li>Adding or changing a location </li></ul><pre> loc1 = frepple.location(name="Manufacturing sites") loc2 = frepple.location(name="site A", category="cat A", owner=loc1) </pre><div class='vspace'></div><ul><li>Deleting a location </li></ul><pre> frepple.location(name="site A", action="R") </pre> </div> <!--PageFooterFmt--> <!--HTMLFooter--> </div></div> </body> </html>