Version 6.6.0 (2025-02-11): Originalversion auf Lehrerfortbildungsserver (2022)
This commit is contained in:
parent
7f19235667
commit
c922801a4e
211 changed files with 7084 additions and 0 deletions
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7E7395BB-8C4B-43FE-B303-40EBD0293BC2}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DistanzVektorAlgorithmusGenerator</RootNamespace>
|
||||
<AssemblyName>DistanzVektorAlgorithmusGenerator</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EPPlus, Version=0.0.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\EPPlus.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GraphAlgorithms, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\GraphAlgorithms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="GraphLibrary, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\GraphLibrary.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="EPPlus.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="GraphAlgorithms.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="GraphLibrary.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
BIN
Quellcodes/DistanzVektorAlgorithmusGenerator/EPPlus.dll
Normal file
BIN
Quellcodes/DistanzVektorAlgorithmusGenerator/EPPlus.dll
Normal file
Binary file not shown.
212
Quellcodes/DistanzVektorAlgorithmusGenerator/Form1.Designer.cs
generated
Normal file
212
Quellcodes/DistanzVektorAlgorithmusGenerator/Form1.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
namespace DistanzVektorAlgorithmusGenerator
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Erforderliche Designervariable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendete Ressourcen bereinigen.
|
||||
/// </summary>
|
||||
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Vom Windows Form-Designer generierter Code
|
||||
|
||||
/// <summary>
|
||||
/// Erforderliche Methode für die Designerunterstützung.
|
||||
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.graphControl1 = new GraphLibrary.GraphControl();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.listBox1 = new System.Windows.Forms.ListBox();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// graphControl1
|
||||
//
|
||||
this.graphControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.graphControl1.Graph = null;
|
||||
this.graphControl1.Location = new System.Drawing.Point(12, 12);
|
||||
this.graphControl1.Name = "graphControl1";
|
||||
this.graphControl1.NodeRadius = 30;
|
||||
this.graphControl1.Options = GraphLibrary.GraphControl.DisplayOptions.ShowNodeLabels;
|
||||
this.graphControl1.Size = new System.Drawing.Size(394, 528);
|
||||
this.graphControl1.TabIndex = 0;
|
||||
this.graphControl1.NodeDoubleClicked += new GraphLibrary.GraphControl.NodeDoubleClickHandler(this.graphControl1_NodeDoubleClicked);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(412, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(95, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Namen (bis zu 14):";
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBox1.Location = new System.Drawing.Point(415, 25);
|
||||
this.textBox1.Multiline = true;
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(209, 181);
|
||||
this.textBox1.TabIndex = 2;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(412, 214);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(83, 13);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Anzahl Runden:";
|
||||
//
|
||||
// numericUpDown1
|
||||
//
|
||||
this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.numericUpDown1.Location = new System.Drawing.Point(498, 212);
|
||||
this.numericUpDown1.Minimum = new decimal(new int[] {
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.numericUpDown1.Name = "numericUpDown1";
|
||||
this.numericUpDown1.Size = new System.Drawing.Size(126, 20);
|
||||
this.numericUpDown1.TabIndex = 4;
|
||||
this.numericUpDown1.Value = new decimal(new int[] {
|
||||
4,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.Location = new System.Drawing.Point(415, 238);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(209, 23);
|
||||
this.button1.TabIndex = 5;
|
||||
this.button1.Text = "Generieren";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(412, 293);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(136, 13);
|
||||
this.label3.TabIndex = 6;
|
||||
this.label3.Text = "Optimale Route von ... aus:";
|
||||
//
|
||||
// listBox1
|
||||
//
|
||||
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.listBox1.FormattingEnabled = true;
|
||||
this.listBox1.Location = new System.Drawing.Point(415, 309);
|
||||
this.listBox1.Name = "listBox1";
|
||||
this.listBox1.Size = new System.Drawing.Size(209, 199);
|
||||
this.listBox1.TabIndex = 7;
|
||||
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button2.Location = new System.Drawing.Point(415, 267);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(101, 23);
|
||||
this.button2.TabIndex = 8;
|
||||
this.button2.Text = "Laden...";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button3.Enabled = false;
|
||||
this.button3.Location = new System.Drawing.Point(522, 267);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(101, 23);
|
||||
this.button3.TabIndex = 9;
|
||||
this.button3.Text = "Speichern...";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button4.Enabled = false;
|
||||
this.button4.Location = new System.Drawing.Point(415, 517);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(208, 23);
|
||||
this.button4.TabIndex = 10;
|
||||
this.button4.Text = "Blätter erzeugen";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(636, 552);
|
||||
this.Controls.Add(this.button4);
|
||||
this.Controls.Add(this.button3);
|
||||
this.Controls.Add(this.button2);
|
||||
this.Controls.Add(this.listBox1);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.numericUpDown1);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.graphControl1);
|
||||
this.Name = "Form1";
|
||||
this.Text = "Distanzvektoralgorithmus";
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private GraphLibrary.GraphControl graphControl1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.NumericUpDown numericUpDown1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.ListBox listBox1;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
}
|
||||
}
|
||||
|
||||
499
Quellcodes/DistanzVektorAlgorithmusGenerator/Form1.cs
Normal file
499
Quellcodes/DistanzVektorAlgorithmusGenerator/Form1.cs
Normal file
|
|
@ -0,0 +1,499 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using GraphLibrary;
|
||||
using GraphAlgorithms;
|
||||
using OfficeOpenXml;
|
||||
using System.IO;
|
||||
|
||||
namespace DistanzVektorAlgorithmusGenerator
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
graphControl1.Options |= GraphControl.DisplayOptions.ShowEdgeWeights;
|
||||
#if DEBUG
|
||||
textBox1.Text = "Moritz\r\nLuka\r\nDavid\r\nLeander\r\nNico\r\nJoshua\r\nMonica\r\nHannes\r\nCaroline\r\nPaul\r\nSimon";
|
||||
#endif
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs ea)
|
||||
{
|
||||
graphControl1_NodeDoubleClicked(null, null);
|
||||
graphControl1.Graph = new Graph(false);
|
||||
string[] names = textBox1.Text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
Random r = new Random();
|
||||
foreach (string s in names)
|
||||
{
|
||||
Node n = graphControl1.Graph.Nodes.Add(s);
|
||||
n.Color = Color.White;
|
||||
n.Position = new Point(r.Next(2 * graphControl1.NodeRadius, graphControl1.Width - graphControl1.NodeRadius * 4),
|
||||
r.Next(2 * graphControl1.NodeRadius, graphControl1.Height - 4 * graphControl1.NodeRadius));
|
||||
}
|
||||
for (int i = 1; i < graphControl1.Graph.Nodes.Count; i++)
|
||||
{
|
||||
Edge e = graphControl1.Graph.Edges.Add(graphControl1.Graph.Nodes[i - 1], graphControl1.Graph.Nodes[i]);
|
||||
e.Weight = r.Next(1, 25);
|
||||
}
|
||||
while (true)
|
||||
{
|
||||
int diameter = UnweightedDiameter();
|
||||
if (diameter <= numericUpDown1.Value)
|
||||
break;
|
||||
int s = -1;
|
||||
int t = -1;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (s != t)
|
||||
{
|
||||
Node sn = graphControl1.Graph.Nodes[s];
|
||||
Node tn = graphControl1.Graph.Nodes[t];
|
||||
if (sn.OutEdges[tn] == null)
|
||||
{
|
||||
if (sn.OutEdges.Count <= 4 && tn.OutEdges.Count <= 4)
|
||||
{
|
||||
Edge e = graphControl1.Graph.Edges.Add(sn, tn);
|
||||
e.Weight = r.Next(1, 25);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
s = r.Next(graphControl1.Graph.Nodes.Count);
|
||||
t = r.Next(graphControl1.Graph.Nodes.Count);
|
||||
}
|
||||
}
|
||||
foreach (Node n in graphControl1.Graph.Nodes)
|
||||
{
|
||||
while (n.OutEdges.Count < 3)
|
||||
{
|
||||
List<Node> fewEdges = new List<Node>();
|
||||
foreach (Node n2 in graphControl1.Graph.Nodes)
|
||||
{
|
||||
if (n2.OutEdges.Count <= 4 && n2 != n && n.OutEdges[n2] == null)
|
||||
{
|
||||
fewEdges.Add(n2);
|
||||
}
|
||||
}
|
||||
if (fewEdges.Count == 0)
|
||||
break;
|
||||
int x = r.Next(fewEdges.Count);
|
||||
Node tn = fewEdges[x];
|
||||
Edge e = graphControl1.Graph.Edges.Add(n, tn);
|
||||
e.Weight = r.Next(1, 25);
|
||||
}
|
||||
}
|
||||
button3.Enabled = true;
|
||||
button4.Enabled = true;
|
||||
}
|
||||
|
||||
private int UnweightedDiameter()
|
||||
{
|
||||
int diameter = 0;
|
||||
for (int i = 0; i < graphControl1.Graph.Nodes.Count; i++)
|
||||
{
|
||||
Node s = graphControl1.Graph.Nodes[i];
|
||||
for (int j = i + 1; j < graphControl1.Graph.Nodes.Count; j++)
|
||||
{
|
||||
Node t = graphControl1.Graph.Nodes[j];
|
||||
List<Node> path = GraphAlgorithms.GraphAlgorithms.Breitensuche(graphControl1.Graph, s, t);
|
||||
if (path.Count - 1 > diameter)
|
||||
{
|
||||
diameter = path.Count - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return diameter;
|
||||
}
|
||||
|
||||
List<Node>[] paths;
|
||||
|
||||
private void graphControl1_NodeDoubleClicked(object sender, Node node)
|
||||
{
|
||||
if (graphControl1.Graph != null)
|
||||
{
|
||||
foreach (Edge e in graphControl1.Graph.Edges)
|
||||
e.Color = Color.Black;
|
||||
}
|
||||
listBox1.Items.Clear();
|
||||
if (node == null)
|
||||
{
|
||||
paths = null;
|
||||
label3.Text = "Optimale Route von ... aus:";
|
||||
return;
|
||||
}
|
||||
paths = new List<Node>[graphControl1.Graph.Nodes.Count - 1];
|
||||
label3.Text = "Optimale Route von '" + node.Label + "' aus:";
|
||||
foreach (Node n in graphControl1.Graph.Nodes)
|
||||
{
|
||||
if (n != node)
|
||||
{
|
||||
List<Node> l = GraphAlgorithms.GraphAlgorithms.Dijkstra(graphControl1.Graph, node, n);
|
||||
float weight = 0;
|
||||
for (int i = 1; i < l.Count; i++)
|
||||
{
|
||||
weight += l[i - 1].OutEdges[l[i]].Weight;
|
||||
}
|
||||
paths[listBox1.Items.Count] = l;
|
||||
listBox1.Items.Add(n.Label + " über " + l[1].Label + " (" + weight + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void listBox1_SelectedIndexChanged(object sender, EventArgs ea)
|
||||
{
|
||||
foreach (Edge e in graphControl1.Graph.Edges)
|
||||
e.Color = Color.Black;
|
||||
if (paths != null && listBox1.SelectedIndex >= 0)
|
||||
{
|
||||
List<Node> p = paths[listBox1.SelectedIndex];
|
||||
for (int i = 1; i < p.Count; i++)
|
||||
{
|
||||
Node src = p[i - 1];
|
||||
src.OutEdges[p[i]].Color = Color.Red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.Filter = "Graph-Beschreibungen (*.xml)|*.xml";
|
||||
if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
graphControl1.Graph = new Graph(ofd.FileName);
|
||||
textBox1.Text = string.Empty;
|
||||
foreach (Node n in graphControl1.Graph.Nodes)
|
||||
{
|
||||
textBox1.Text += n.Label + "\r\n";
|
||||
button3.Enabled = true;
|
||||
button4.Enabled = true;
|
||||
}
|
||||
label3.Text = "Optimale Route von ... aus:";
|
||||
listBox1.Items.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void button3_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "Graph-Beschreibungen (*.xml)|*.xml";
|
||||
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
if (graphControl1.Graph != null)
|
||||
{
|
||||
foreach (Edge ed in graphControl1.Graph.Edges)
|
||||
ed.Color = Color.Black;
|
||||
}
|
||||
graphControl1.Graph.SaveToXml(sfd.FileName);
|
||||
listBox1_SelectedIndexChanged(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public double MeasureTextWidth(string text, OfficeOpenXml.Style.ExcelFont font)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text)) return 0.0;
|
||||
var bitmap = new Bitmap(1, 1);
|
||||
var graphics = Graphics.FromImage(bitmap);
|
||||
|
||||
var drawingFont = new Font(font.Name, font.Size);
|
||||
var size = graphics.MeasureString(text, drawingFont, 1000);
|
||||
|
||||
//72 DPI and 96 points per inch. Excel height in points with max of 409 per Excel requirements.
|
||||
return Math.Min(Convert.ToDouble(size.Width) * 72 / 96, 409);
|
||||
}
|
||||
|
||||
private void button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (graphControl1.Graph != null)
|
||||
{
|
||||
if (graphControl1.Graph.Nodes.Count > 14)
|
||||
{
|
||||
MessageBox.Show("Warnung: Bei mehr als 14 Knoten kann es zu Darstellungsproblemen kommen.");
|
||||
}
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "Excel-Dateien (*.xlsx)|*.xlsx";
|
||||
if (sfd.ShowDialog() != System.Windows.Forms.DialogResult.OK)
|
||||
return;
|
||||
try
|
||||
{
|
||||
FileInfo fi = new FileInfo(sfd.FileName);
|
||||
fi.Delete();
|
||||
double? headerHeight = null;
|
||||
using (ExcelPackage excelFile = new ExcelPackage(fi))
|
||||
{
|
||||
ExcelStyleCollection<OfficeOpenXml.Style.XmlAccess.ExcelNamedStyleXml> oldStyles = excelFile.Workbook.Styles.NamedStyles;
|
||||
OfficeOpenXml.Style.XmlAccess.ExcelNamedStyleXml headerStyle = excelFile.Workbook.Styles.CreateNamedStyle("Header", oldStyles[0].Style);
|
||||
headerStyle.Style.TextRotation = 90;
|
||||
headerStyle.Style.Font.Size = 11;
|
||||
headerStyle.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
OfficeOpenXml.Style.XmlAccess.ExcelNamedStyleXml grayedStyle = excelFile.Workbook.Styles.CreateNamedStyle("Grayed", oldStyles[0].Style);
|
||||
grayedStyle.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
|
||||
grayedStyle.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(170, 170, 170));
|
||||
OfficeOpenXml.Style.XmlAccess.ExcelNamedStyleXml crossedStyle = excelFile.Workbook.Styles.CreateNamedStyle("Crossed", oldStyles[0].Style);
|
||||
crossedStyle.Style.Border.DiagonalDown = true;
|
||||
crossedStyle.Style.Border.DiagonalUp = true;
|
||||
crossedStyle.Style.Border.Diagonal.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
double LINE_HEIGHT = 26;
|
||||
double GAP_HEIGHT = 40;
|
||||
double FACTOR = 0.037; // eine Einheit entspricht 0,035 cm
|
||||
int nNumTablesPerPage;
|
||||
for (int iN = 0; iN < graphControl1.Graph.Nodes.Count; iN++)
|
||||
{
|
||||
Node n = graphControl1.Graph.Nodes[iN];
|
||||
ExcelWorksheet sheet = excelFile.Workbook.Worksheets.Add(n.Label);
|
||||
sheet.HeaderFooter.OddHeader.CenteredText = n.Label;
|
||||
sheet.Cells.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
|
||||
sheet.PrinterSettings.PaperSize = ePaperSize.A4;
|
||||
if (!headerHeight.HasValue)
|
||||
{
|
||||
headerHeight = 0;
|
||||
foreach (Node nn in graphControl1.Graph.Nodes)
|
||||
{
|
||||
double h = MeasureTextWidth("über\r\n" + nn.Label, headerStyle.Style.Font);
|
||||
if (h > headerHeight) headerHeight = h;
|
||||
}
|
||||
headerHeight = Math.Ceiling(headerHeight.Value + 5);
|
||||
}
|
||||
string strNeighbors = "";
|
||||
if (n.OutEdges.Count == 1)
|
||||
strNeighbors = n.OutEdges[0].Target.Label;
|
||||
else
|
||||
{
|
||||
for (int iE = 0; iE < n.OutEdges.Count; iE++)
|
||||
{
|
||||
if (iE == n.OutEdges.Count - 1)
|
||||
{
|
||||
strNeighbors += " und ";
|
||||
}
|
||||
else if (iE > 0)
|
||||
{
|
||||
strNeighbors += ", ";
|
||||
}
|
||||
strNeighbors += n.OutEdges[iE].Target.Label;
|
||||
}
|
||||
}
|
||||
string strIntro = string.Format("Die folgenden Schritte müssen in jedem Zeitschritt durchgeführt werden:\r\n" +
|
||||
"1. Bestimmen Sie Ihren Distanzvektor. Er besteht aus dem kleinsten Wert jeder Zeile. Tragen Sie die Werte in die Spalte ganz rechts ein.\r\n" +
|
||||
"2. Tragen Sie diese Werte auf jedes Nachrichtenblatt ein und geben Sie es jeweils an Ihre Nachbarn ({0}).\r\n" +
|
||||
"3. Sie erhalten im Gegenzug Nachrichten von Ihren Nachbarn, z.B. von {1}. Sein/Ihr Abstand zu Ihnen ist {2}, tragen Sie also alle Werte, " +
|
||||
"die Sie von ihm/ihr erhalten in die Spalte \"über {1}\" ein und addieren Sie jeweils {2}.", strNeighbors, n.OutEdges[0].Target.Label, n.OutEdges[0].Weight);
|
||||
sheet.Cells[1, 1, 1, graphControl1.Graph.Nodes.Count + 3].Merge = true;
|
||||
sheet.Cells[1, 1].Value = strIntro;
|
||||
sheet.Cells[1, 1].Style.WrapText = true;
|
||||
sheet.Row(1).Height = 3.8 / FACTOR;
|
||||
sheet.Row(2).Height = 0.5 / FACTOR;
|
||||
|
||||
sheet.Cells[1, 1, 1, graphControl1.Graph.Nodes.Count + 3].Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
|
||||
|
||||
double tableHeight = (headerHeight.Value + LINE_HEIGHT * graphControl1.Graph.Nodes.Count) * FACTOR;
|
||||
|
||||
double gapHeightCM = GAP_HEIGHT * FACTOR;
|
||||
|
||||
double dNumberOfTablesPerPage = (29.7 - 1.7 - 2.5 + gapHeightCM) / (tableHeight + gapHeightCM);
|
||||
while (dNumberOfTablesPerPage % 1 > 0.85)
|
||||
{
|
||||
if (GAP_HEIGHT > 30)
|
||||
GAP_HEIGHT--;
|
||||
else
|
||||
LINE_HEIGHT--;
|
||||
tableHeight = (headerHeight.Value + LINE_HEIGHT * graphControl1.Graph.Nodes.Count) * FACTOR;
|
||||
dNumberOfTablesPerPage = (29.7 - 1.7 - 2.5 + gapHeightCM) / (tableHeight + gapHeightCM);
|
||||
}
|
||||
// nNumTablesPerPage = (int)dNumberOfTablesPerPage;
|
||||
|
||||
double lowerEnd = 3.8 + 0.5;
|
||||
|
||||
for (int time = 0; time <= numericUpDown1.Value; time++)
|
||||
{
|
||||
int lineBase = 3 + time * (2 + graphControl1.Graph.Nodes.Count);
|
||||
if (lowerEnd + tableHeight + FACTOR > 29.7 - 1.7 - 2.5)
|
||||
{
|
||||
sheet.Row(lineBase - 1).Height = 1;
|
||||
sheet.Row(lineBase - 1).PageBreak = true;
|
||||
lowerEnd = tableHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (time > 0)
|
||||
sheet.Row(lineBase - 1).Height = GAP_HEIGHT;
|
||||
lowerEnd += tableHeight + gapHeightCM;
|
||||
}
|
||||
sheet.Cells[lineBase, 1].Value = "Zeitschritt\r\n" + time;
|
||||
sheet.Cells[lineBase, 1].Style.Font.Size = 13;
|
||||
sheet.Cells[lineBase, 1].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
for (int i = 0; i < graphControl1.Graph.Nodes.Count; i++)
|
||||
{
|
||||
Node other = graphControl1.Graph.Nodes[i];
|
||||
sheet.Cells[lineBase + i + 1, 1].Value = "zu " + other.Label;
|
||||
sheet.Cells[lineBase + i + 1, 1].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Left;
|
||||
sheet.Cells[lineBase, 2 + i].Value = "über\r\n" + other.Label;
|
||||
sheet.Row(lineBase + i + 1).Height = LINE_HEIGHT;
|
||||
Edge ed = n.OutEdges[other];
|
||||
if (ed == null)
|
||||
sheet.Cells[lineBase + 1, 2 + i, lineBase + graphControl1.Graph.Nodes.Count, 2 + i].StyleName = "Crossed";
|
||||
else
|
||||
{
|
||||
sheet.Cells[lineBase + 1 + i, 2 + i].Value = (int)ed.Weight;
|
||||
sheet.Cells[lineBase + 1 + i, 2 + i].Style.Font.Size = 15;
|
||||
sheet.Cells[lineBase + 1 + i, 2 + i].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
if (time == 0)
|
||||
{
|
||||
sheet.Cells[lineBase + 1 + i, 2 + graphControl1.Graph.Nodes.Count].Value = (int)ed.Weight;
|
||||
sheet.Cells[lineBase + 1 + i, 2 + graphControl1.Graph.Nodes.Count].Style.Font.Size = 15;
|
||||
sheet.Cells[lineBase + 1 + i, 2 + graphControl1.Graph.Nodes.Count].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
}
|
||||
}
|
||||
}
|
||||
sheet.Cells[iN + lineBase + 1, 2, iN + lineBase + 1, 2 + graphControl1.Graph.Nodes.Count].StyleName = "Grayed";
|
||||
sheet.Cells[lineBase + 1, 2 + iN, lineBase + graphControl1.Graph.Nodes.Count, 2 + iN].StyleName = "Grayed";
|
||||
sheet.Cells[lineBase, 2 + graphControl1.Graph.Nodes.Count].Value = "Distanz-\r\nvektor";
|
||||
sheet.Cells[lineBase, 2, lineBase, graphControl1.Graph.Nodes.Count + 2].StyleName = "Header";
|
||||
sheet.Row(lineBase).Height = headerHeight.Value;
|
||||
ExcelRange all = sheet.Cells[lineBase, 1, lineBase + graphControl1.Graph.Nodes.Count, graphControl1.Graph.Nodes.Count + 2];
|
||||
all.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
all.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
all.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
all.Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
sheet.Cells[lineBase, graphControl1.Graph.Nodes.Count + 2, lineBase + graphControl1.Graph.Nodes.Count, graphControl1.Graph.Nodes.Count + 2].Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Double;
|
||||
|
||||
}
|
||||
for (int i = 0; i <= graphControl1.Graph.Nodes.Count; i++)
|
||||
{
|
||||
sheet.Column(2 + i).Width = 5; // 0,98 cm => 1 entspricht 0,2 cm Breite
|
||||
}
|
||||
ExcelColumn col = sheet.Column(1);
|
||||
col.AutoFit();
|
||||
double maxFirstCol = 17.2 - (graphControl1.Graph.Nodes.Count + 1) * 0.98;
|
||||
if (maxFirstCol * 5 < col.Width)
|
||||
col.Width = maxFirstCol * 5;
|
||||
sheet.Column(3 + graphControl1.Graph.Nodes.Count).Width = 5 * Math.Max(0, 17.2 - (col.Width / 5 + (graphControl1.Graph.Nodes.Count + 1) * 0.98));
|
||||
}
|
||||
ExcelWorksheet shMsgs = excelFile.Workbook.Worksheets.Add("Nachrichten");
|
||||
shMsgs.Cells.Style.Font.Size = 13;
|
||||
int row = 1;
|
||||
shMsgs.Column(1).Width = 15;
|
||||
for (int i = 1; i < numericUpDown1.Value; i++)
|
||||
shMsgs.Column(i + 1).Width = 8;
|
||||
shMsgs.Cells.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
|
||||
LINE_HEIGHT = 21;
|
||||
GAP_HEIGHT = LINE_HEIGHT;
|
||||
|
||||
double HEADER_HEIGHT = 3 * 15 + 19;
|
||||
double cardHeight = (HEADER_HEIGHT + LINE_HEIGHT * graphControl1.Graph.Nodes.Count) * FACTOR;
|
||||
|
||||
double gh = 2 * GAP_HEIGHT * FACTOR;
|
||||
|
||||
double dNumberOfCardsPerPage = (29.7 - 2.5 - 2.5 + gh) / (cardHeight + gh);
|
||||
while (dNumberOfCardsPerPage % 1 > 0.85)
|
||||
{
|
||||
if (GAP_HEIGHT > 15)
|
||||
GAP_HEIGHT--;
|
||||
else
|
||||
LINE_HEIGHT--;
|
||||
cardHeight = (headerHeight.Value + LINE_HEIGHT * graphControl1.Graph.Nodes.Count) * FACTOR;
|
||||
dNumberOfCardsPerPage = (29.7 - 2.5 - 2.5 + gh) / (cardHeight + gh);
|
||||
}
|
||||
nNumTablesPerPage = (int)dNumberOfCardsPerPage;
|
||||
int countTables = 0;
|
||||
for (int i = 0; i < graphControl1.Graph.Nodes.Count; i++)
|
||||
{
|
||||
Node src = graphControl1.Graph.Nodes[i];
|
||||
for (int j = 0; j < src.OutEdges.Count; j++)
|
||||
{
|
||||
countTables++;
|
||||
int firstRow = row;
|
||||
Node trg = src.OutEdges[j].Target;
|
||||
shMsgs.Cells[row, 1].Value = "Von: " + src.Label;
|
||||
shMsgs.Cells[row, 1, row, 2].Merge = true;
|
||||
shMsgs.Cells[row, 3].Value = "An: " + trg.Label;
|
||||
shMsgs.Cells[row, 3, row, (int)numericUpDown1.Value + 1].Merge = true;
|
||||
row++;
|
||||
shMsgs.Cells[row, 1].Value = "Mein neuer Distanzvektor";
|
||||
shMsgs.Cells[row, 1].Style.Font.Bold = true;
|
||||
shMsgs.Cells[row, 1].Style.Font.Size += 2;
|
||||
shMsgs.Row(row).Height = 19;
|
||||
shMsgs.Cells[row, 1].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
shMsgs.Cells[row, 1, row, (int)numericUpDown1.Value + 1].Merge = true;
|
||||
row++;
|
||||
shMsgs.Cells[row, 1].Value = "Distanz\r\nzu:";
|
||||
shMsgs.Cells[row, 1, row + 1, 1].Merge = true;
|
||||
shMsgs.Cells[row, 2].Value = "nach Zeitschritt";
|
||||
shMsgs.Cells[row, 2].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
shMsgs.Cells[row, 2, row, (int)numericUpDown1.Value + 1].Merge = true;
|
||||
row++;
|
||||
for (int k = 0; k < numericUpDown1.Value; k++)
|
||||
{
|
||||
shMsgs.Cells[row, 2 + k].Value = k;
|
||||
shMsgs.Cells[row, 2 + k].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
}
|
||||
row++;
|
||||
foreach (Node n in graphControl1.Graph.Nodes)
|
||||
{
|
||||
shMsgs.Cells[row, 1].Value = n.Label;
|
||||
shMsgs.Row(row).Height = LINE_HEIGHT;
|
||||
if (n == src || n == trg)
|
||||
{
|
||||
for (int k = 0; k < numericUpDown1.Value; k++)
|
||||
{
|
||||
shMsgs.Cells[row, 2 + k].Style.Border.Diagonal.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
shMsgs.Cells[row, 2 + k].Style.Border.DiagonalDown = true;
|
||||
shMsgs.Cells[row, 2 + k].Style.Border.DiagonalUp = true;
|
||||
}
|
||||
}
|
||||
row++;
|
||||
}
|
||||
ExcelRange range = shMsgs.Cells[firstRow, 1, row - 1, (int)numericUpDown1.Value + 1];
|
||||
range.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
range.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||
shMsgs.Cells[firstRow + 2, 2].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.None;
|
||||
shMsgs.Cells[firstRow + 3, 2, firstRow + 3, (int)numericUpDown1.Value + 1].Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.None;
|
||||
if (countTables == nNumTablesPerPage)
|
||||
{
|
||||
shMsgs.Row(row).Height = 1;
|
||||
shMsgs.Row(row).PageBreak = true;
|
||||
countTables = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
shMsgs.Row(row).Height = GAP_HEIGHT;
|
||||
ExcelRange er = shMsgs.Cells[row, 1];
|
||||
er.Value = "(hier auseinanderschneiden)";
|
||||
er.Style.Font.Size = 8;
|
||||
er.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Bottom;
|
||||
er.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
shMsgs.Cells[row, 1, row, (int)numericUpDown1.Value + 2].Merge = true;
|
||||
shMsgs.Cells[row, 1, row, (int)numericUpDown1.Value + 2].Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Dashed;
|
||||
row++;
|
||||
er = shMsgs.Cells[row, 1];
|
||||
er.Value = "(hier auseinanderschneiden)";
|
||||
er.Style.Font.Size = 8;
|
||||
er.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
|
||||
er.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
|
||||
shMsgs.Cells[row, 1, row, (int)numericUpDown1.Value + 2].Merge = true;
|
||||
shMsgs.Row(row).Height = GAP_HEIGHT;
|
||||
}
|
||||
row++;
|
||||
}
|
||||
}
|
||||
shMsgs.Column((int)numericUpDown1.Value + 2).Width = 5 * Math.Max(0, 17.2 - (3 + 1.8*(double)numericUpDown1.Value));
|
||||
excelFile.Save();
|
||||
}
|
||||
}
|
||||
catch (Exception x)
|
||||
{
|
||||
MessageBox.Show(x.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Quellcodes/DistanzVektorAlgorithmusGenerator/Form1.resx
Normal file
120
Quellcodes/DistanzVektorAlgorithmusGenerator/Form1.resx
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
BIN
Quellcodes/DistanzVektorAlgorithmusGenerator/GraphAlgorithms.dll
Normal file
BIN
Quellcodes/DistanzVektorAlgorithmusGenerator/GraphAlgorithms.dll
Normal file
Binary file not shown.
BIN
Quellcodes/DistanzVektorAlgorithmusGenerator/GraphLibrary.dll
Normal file
BIN
Quellcodes/DistanzVektorAlgorithmusGenerator/GraphLibrary.dll
Normal file
Binary file not shown.
21
Quellcodes/DistanzVektorAlgorithmusGenerator/Program.cs
Normal file
21
Quellcodes/DistanzVektorAlgorithmusGenerator/Program.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DistanzVektorAlgorithmusGenerator
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Der Haupteinstiegspunkt für die Anwendung.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die mit einer Assembly verknüpft sind.
|
||||
[assembly: AssemblyTitle("DistanzVektorAlgorithmusGenerator")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DistanzVektorAlgorithmusGenerator")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
|
||||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("1f6d7e9e-20d1-4d9d-8b50-a48548c80f06")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
71
Quellcodes/DistanzVektorAlgorithmusGenerator/Properties/Resources.Designer.cs
generated
Normal file
71
Quellcodes/DistanzVektorAlgorithmusGenerator/Properties/Resources.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Dieser Code wurde von einem Tool generiert.
|
||||
// Laufzeitversion:4.0.30319.42000
|
||||
//
|
||||
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
|
||||
// der Code neu generiert wird.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DistanzVektorAlgorithmusGenerator.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
/// </summary>
|
||||
// Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse
|
||||
// über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
// mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DistanzVektorAlgorithmusGenerator.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
30
Quellcodes/DistanzVektorAlgorithmusGenerator/Properties/Settings.Designer.cs
generated
Normal file
30
Quellcodes/DistanzVektorAlgorithmusGenerator/Properties/Settings.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DistanzVektorAlgorithmusGenerator.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
Loading…
Add table
Add a link
Reference in a new issue