This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildingDesignParameters.cs
More file actions
50 lines (46 loc) · 1.59 KB
/
BuildingDesignParameters.cs
File metadata and controls
50 lines (46 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IDFObjects
{
[Serializable]
public class BuildingDesignParameters
{
public string Name;
public BuildingGeometry Geometry;
public BuildingConstruction Construction;
public BuildingWWR WWR;
public BuildingService Service;
public List<ZoneConditions> ZConditions = new List<ZoneConditions>();
public BuildingDesignParameters() { }
public string Header(string sep) =>
string.Join(sep,
Geometry.Header(sep),
Construction.Header(sep),
WWR.Header(sep),
Service.Header(sep),
string.Join(sep, ZConditions.Select(o => o.Header(sep))));
public string ToString(string sep) =>
string.Join(sep,
Geometry.ToString(sep),
Construction.ToString(sep),
WWR.ToString(sep),
Service.ToString(sep),
string.Join(sep, ZConditions.Select(o => o.ToString(sep))));
private Random _random;
public Random Random {
get
{
if (_random == null)
{
int seed = (int)Math.Ceiling(typeof(BuildingGeometry).GetFields().
Where(f => f.FieldType == typeof(float)).Select(f => 1000*(float)f.GetValue(this.Geometry)).Sum());
_random = new Random(seed);
}
return _random;
}
}
}
}