SDMP User Manual (ENG)
  • Introduction
    • Introduction to SDMP
  • Getting Started
    • Creating SDMP Project
  • Data Handling
    • Loading Input Data
      • Defining Input Data Schema
      • Creating Input Data
      • Loading Input Data
    • Retriving Data
    • Writing Output Data
      • Defining Output Data Schema
      • Adding Data Row
      • Writing to File
  • General Module
    • Overview
    • User Controls
      • StateControl
      • ActionControl
      • StateTransitionControl
      • BoundControl
      • ApproximationControl
      • SolverControl
      • EventControl
      • DataControl
      • LogControl
    • Data Model
      • State
      • StateActionMap
    • Example Problems
      • Car Resequencing Problem
      • Lot Sizing Problem
  • Routing Module
    • Overview
    • User Controls
      • CustomerControl
      • VehicleControl
    • Data Model
    • Example Problems
      • Vehicle Routing Problem
  • Scheduling Module
    • Overview
    • User Controls
    • Data Model
    • Example Problems
Powered by GitBook
On this page
  • 1. Add input schema file
  • 2. Define input schema and KeyMappings
  1. Data Handling
  2. Loading Input Data

Defining Input Data Schema

Describes how users define the input data schema

PreviousLoading Input DataNextCreating Input Data

Last updated 1 year ago

1. Add input schema file

In the MyInputs folder in your solution, right-click and select "Add (D)" > "Add New Item (W)...". Select the InputData item from the list of items, name it [schema name].cs, and press the "Add (A)" button to add it. The example below shows the screen for adding an input schema named "SampleData".

2. Define input schema and KeyMappings

Define column names and data types in the added input schema file. There is no limit to the number of columns you can define and you are free to add as many as you need. The example below defines two columns "COL_1", "COL_2" of type String.

using Nodez.Data;
using Nodez.Data.Interface;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace Nodez.Project.Template.MyInputs
{
    public class SampleData : IInputRow
    {
        // Define columns here (NOTICE: The column name defined here and the column name defined in the data file must match.)

        public string COL_1 { get; private set; }

        public string COL_2 { get; private set; }

        public SampleData()
        {
            // Define keys here (You can search data with the key defined here. Allow multiple keys)

            HashSet<string> key = new HashSet<string>();
            key.Add("COL_1");

            this.KeyMappings.Add(1, key);

            HashSet<string> key2 = new HashSet<string>();
            key2.Add("COL_1");
            key2.Add("COL_2");

            this.KeyMappings.Add(2, key);
        }
    }
}

The column names defined in the input schema file must match the column names defined in the input data file. We recommend that you also define the data type for each column defined in the input schema file to match what is defined in the input data file.

You can add KeyMappings as needed to look up data through defined keys. KeyMappings can be added through the constructor of the schema file. The example code below creates a KeyMappings with "COL_1" as the Key and another with "COL1" and "COL_2" as the Key. KeyMappings are Dictionary structures with Int as a key, and you can access each KeyMapping through the Key of the KeyMappings. You can see how to retrieve data through KeyMappings .

Adding an input schema file
Adding Input Schema File
here