{"data":{"markdownRemark":{"html":"<h2 id=\"introduction\"><a href=\"#introduction\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Introduction</h2>\n<p>The <code class=\"language-text\">Product</code> class provides a basic class for defining a unit that is moved between <code class=\"language-text\">Facility</code> agents. This is a class that you are free to extend to include other dimensions that might be of use in your desired simulation (addition of new fields or unique product types, etc)</p>\n<h2 id=\"product-class\"><a href=\"#product-class\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Product Class</h2>\n<p>The <code class=\"language-text\">Product</code> class is provided and free to extend, the object contains the following fields:</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\">String productID<span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">double</span> volume<span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">double</span> weight<span class=\"token punctuation\">;</span>\nString trailerID<span class=\"token punctuation\">;</span></code></pre></div>\n<p>These are just base features for representing a unit and can be extended to represent more complex or differentiated product / unit types:</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\"><span class=\"token keyword\">public</span> <span class=\"token keyword\">class</span> <span class=\"token class-name\">ElectronicProduct</span> <span class=\"token keyword\">extends</span> <span class=\"token class-name\">Product</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">public</span> String originFacility<span class=\"token punctuation\">;</span>\n    <span class=\"token keyword\">public</span> String destinationFacility<span class=\"token punctuation\">;</span>\n    <span class=\"token keyword\">public</span> <span class=\"token keyword\">boolean</span> hazardous<span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>When using a <code class=\"language-text\">TransportMessage</code> to handle shipment and movement between facilities, it's recommended to use the <code class=\"language-text\">Product</code> class as the message is specifically designed to carry these objects.</p>\n<p>There is another option for representing units and products in the simulation.</p>\n<h2 id=\"string-products\"><a href=\"#string-products\" aria-hidden=\"true\" class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>String Products</h2>\n<p>When dealing with large systems with a high volume of products (millions - 100s of millions) under certain circumstances it makes sense to represent the units as a <code class=\"language-text\">String</code> for memory efficiency. This works quite well in situations where the units are created and do not require manipulation once created (adding to the end of the String can be quite easy and efficient but splicing the String is not).</p>\n<p>The <code class=\"language-text\">TransportMessage</code> class has 3 different constructors for handling both <code class=\"language-text\">List&lt;String&gt;</code> and <code class=\"language-text\">List&lt;Product&gt;</code>.</p>\n<p>A Product String can use the same fields as the <code class=\"language-text\">Product</code> class with a unique separator that will be parsed at output.</p>\n<div class=\"gatsby-highlight\" data-language=\"java\"><pre class=\"language-java\"><code class=\"language-java\">String uniqueProductID<span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">double</span> weight<span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">double</span> volume<span class=\"token punctuation\">;</span>\nString origin<span class=\"token punctuation\">;</span>\nString destination<span class=\"token punctuation\">;</span>\n\nString separator <span class=\"token operator\">=</span> <span class=\"token string\">\":\"</span>\n\nnewProductString <span class=\"token operator\">=</span> uniqueProductID <span class=\"token operator\">+</span> separator <span class=\"token operator\">+</span> weight <span class=\"token operator\">+</span> separator <span class=\"token operator\">+</span> volume <span class=\"token operator\">+</span> separator <span class=\"token operator\">+</span> origin <span class=\"token operator\">+</span> separator <span class=\"token operator\">+</span> destination<span class=\"token punctuation\">;</span></code></pre></div>\n<p>This creates the Product String and can be sent using a <code class=\"language-text\">TransportMessage</code> to ship large amounts of information.</p>","headings":[{"value":"Introduction","depth":2},{"value":"Product Class","depth":2},{"value":"String Products","depth":2}],"frontmatter":{"title":"Product","toc":null,"experimental":false}},"site":{"siteMetadata":{"title":"Simudyne Docs","latestVersion":"2.6"}}},"pageContext":{"absolutePath":"/home/vsts/work/1/s/content/2.6/docs/supply_chain_toolkit/product.md","versioned":false,"version":"2.6","kind":"docs","pagePath":"/supply_chain_toolkit/product","chronology":{"prev":{"name":"Loading Bay","path":"/supply_chain_toolkit/loading_bay"},"next":{"name":"Python Visualization","path":"/supply_chain_toolkit/python_visualization"}},"lastUpdated":"2026-04-21T13:56:54.867Z"}}