Skip to content

Commit 81fe06b

Browse files
1.25版本上传 (#12)
* update
1 parent 00a6b14 commit 81fe06b

29 files changed

+962
-37
lines changed

README-Chinese.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AS库目录有多个版本,如果希望查询不同版本的更新日志以及
2323
<dependency>
2424
<groupId>io.github.BeardedManZhao</groupId>
2525
<artifactId>algorithmStar</artifactId>
26-
<version>1.24</version>
26+
<version>1.25</version>
2727
</dependency>
2828
</dependencies>
2929
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ can add it to your maven project, or you can download it from Releases and manua
2929
<dependency>
3030
<groupId>io.github.BeardedManZhao</groupId>
3131
<artifactId>algorithmStar</artifactId>
32-
<version>1.24</version>
32+
<version>1.25</version>
3333
</dependency>
3434
</dependencies>
3535
```

src_code/README-Chinese.md

Lines changed: 178 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,182 @@
88

99
### 更新日志
1010

11-
* 框架版本:1.23 - 1.24
12-
* 紧急修复:针对 AS图像处理库 中的show 函数生成的窗口关闭之后会退出程序的问题进行了优化和处理,使得窗口点击关闭之后不会退出程序。
11+
* 框架版本:1.24 - 1.25
12+
* 更新版本号。
13+
* 移除 RouteNet 接口中“不支持操作异常”针对外部项目的依赖,避免出现下面所列出的异常信息,此版本中无需获取“javax.ws.rs”的第三方依赖。
1314

14-
### Version update date : 2023-08-28
15+
```
16+
Exception in thread "main" java.lang.NoClassDefFoundError: javax/ws/rs/NotSupportedException
17+
at zhao.algorithmMagic.MAIN1.main(MAIN1.java:38)
18+
Caused by: java.lang.ClassNotFoundException: javax.ws.rs.NotSupportedException
19+
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
20+
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
21+
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
22+
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
23+
... 1 more
24+
```
25+
26+
* 新增 Graphx 类,能够在基于线路网络类的前提下通过节点与边表进行图的构造,后期将会对此类新增诸多的操作函数。
27+
28+
```java
29+
package zhao.algorithmMagic;
30+
31+
import zhao.algorithmMagic.integrator.Route2DDrawingIntegrator;
32+
import zhao.algorithmMagic.operands.coordinate.IntegerCoordinateTwo;
33+
import zhao.algorithmMagic.operands.coordinateNet.Graph;
34+
import zhao.algorithmMagic.operands.table.SingletonCell;
35+
36+
37+
public class MAIN1 {
38+
public static void main(String[] args) {
39+
// 首先创建出两个节点的坐标
40+
final IntegerCoordinateTwo c1 = new IntegerCoordinateTwo(-10, 2);
41+
final IntegerCoordinateTwo c2 = new IntegerCoordinateTwo(20, 20);
42+
// 然后创建两个节点数据的表
43+
final Graph.GraphNodeDF nodeDF = Graph.GraphNodeDF.create(
44+
Graph.GraphNodeSeries.create(c1, SingletonCell.$("zhao"), SingletonCell.$("20")),
45+
Graph.GraphNodeSeries.create(c2, SingletonCell.$("TY"), SingletonCell.$("22"))
46+
);
47+
// 然后创建出两个节点之间的边
48+
final Graph.GraphEdgeDF edgeDF = Graph.GraphEdgeDF.create(
49+
// C1 <- 前任 -> C2 代表 C1的前任是C2 C2的前任是C1
50+
Graph.GraphEdgeSeries.create(c1, c2, SingletonCell.$("前任"))
51+
);
52+
// 最后创建图对象
53+
final Graph parse = Graph.create(nodeDF, edgeDF);
54+
55+
// 开始绘制图 首先准备线路绘图器
56+
final Route2DDrawingIntegrator draw = new Route2DDrawingIntegrator("draw", parse);
57+
if (draw.setImageOutPath("C:\\Users\\zhao\\Desktop\\fsdownload\\res.jpg").run()) {
58+
System.out.println("ok!!!");
59+
}
60+
}
61+
}
62+
```
63+
64+
* 针对 Graph 类,我们可以通过 get 函数获取到 node 和 edge 的映射表。
65+
66+
```java
67+
package zhao.algorithmMagic;
68+
69+
import zhao.algorithmMagic.operands.coordinate.IntegerCoordinateTwo;
70+
import zhao.algorithmMagic.operands.coordinateNet.Graph;
71+
import zhao.algorithmMagic.operands.route.IntegerConsanguinityRoute2D;
72+
import zhao.algorithmMagic.operands.table.SingletonCell;
73+
74+
import java.util.Collection;
75+
import java.util.HashMap;
76+
77+
public class MAIN1 {
78+
public static void main(String[] args) {
79+
// 首先创建出两个节点的坐标
80+
final IntegerCoordinateTwo c1 = new IntegerCoordinateTwo(-10, 2), c2 = new IntegerCoordinateTwo(20, 20);
81+
// 然后创建图对象
82+
final Graph parse = Graph.create(
83+
// 创建两个节点数据的表
84+
Graph.GraphNodeDF.create(
85+
Graph.GraphNodeSeries.create(c1, SingletonCell.$("zhao"), SingletonCell.$("20")),
86+
Graph.GraphNodeSeries.create(c2, SingletonCell.$("TY"), SingletonCell.$("22"))
87+
),
88+
// 创建出两个节点之间的边
89+
Graph.GraphEdgeDF.create(
90+
// C1 <- 前任 -> C2 代表 C1的前任是C2 C2的前任是C1
91+
Graph.GraphEdgeSeries.create(c1, c2, SingletonCell.$("前任"))
92+
)
93+
);
94+
// TODO 获取到图对象中的所有节点数据映射表
95+
final HashMap<String, Graph.GraphNodeSeries> nodes = parse.getNodes();
96+
// TODO 获取到图对象中的所有边数据映射表
97+
final HashMap<String, Graph.GraphEdgeSeries> edges = parse.getEdges();
98+
// TODO 获取到图中的所有边数据线路对象
99+
final Collection<IntegerConsanguinityRoute2D> edgesRoute = parse.getEdgesRoute();
100+
// 我们在这里打印其中的每个线路的信息 TODO 我们将通过线路中的数据从映射表中取出详细数据
101+
/*
102+
* nodes映射表中的数据
103+
* +----------+------------+
104+
* | key | value |
105+
* +----------+------------+
106+
* | (-10,2) | zhao |
107+
* | (20,20) | TY |
108+
* +----------+------------+
109+
*
110+
*
111+
* edges映射表中的数据
112+
* +----------------------------------+------------------------------------+
113+
* | key | value |
114+
* +----------------------------------+------------------------------------+
115+
* | (-10,2)(-10,2) -> (20,20)(20,20) | series [(-10,2), (20,20), 前任] |
116+
* +----------------------------------+------------------- ----------------+
117+
* */
118+
edgesRoute.forEach(edge -> {
119+
// 通过坐标名称 从节点映射表中 获取到起始节点与终止节点的数据Series
120+
final Graph.GraphNodeSeries start = nodes.get(edge.getStartingCoordinateName());
121+
final Graph.GraphNodeSeries end = nodes.get(edge.getEndPointCoordinateName());
122+
System.out.println(
123+
"当前线路:" + edge + '\n' +
124+
"起始点:" + edge.getStartingCoordinate() +
125+
// 由于上面构建节点Series的时候 第一个是坐标 第二个是名字 第三个是age
126+
// 所以在这里也是相同的格式
127+
"\t名称:" + start.getCell(1).getValue() + '\n' +
128+
"终止点:" + edge.getEndPointCoordinate() + "\t名称:" + end.getCell(1) + '\n' +
129+
"两个点之间的关系: " + edges.get(edge.toString())
130+
);
131+
});
132+
}
133+
}
134+
```
135+
136+
* 针对 Graphx 系列的 Series 类的构造中,如果配置项全是字符串,那么我们就可以不显式的指定 Cell 单元格构造,是的构造操作更加简洁。
137+
138+
```java
139+
package zhao.algorithmMagic;
140+
141+
import zhao.algorithmMagic.operands.coordinate.IntegerCoordinateTwo;
142+
import zhao.algorithmMagic.operands.coordinateNet.Graph;
143+
144+
public class MAIN1 {
145+
public static void main(String[] args) {
146+
// 首先创建出两个节点的坐标
147+
final IntegerCoordinateTwo c1 = new IntegerCoordinateTwo(-10, 2), c2 = new IntegerCoordinateTwo(20, 20);
148+
// 然后创建图对象
149+
final Graph parse = Graph.create(
150+
// 创建两个节点数据的表 TODO 在这里使用的是字符串,因此不需要使用 Cell 类的构造包装。
151+
Graph.GraphNodeDF.create(
152+
Graph.GraphNodeSeries.create(c1, "zhao", "20"),
153+
Graph.GraphNodeSeries.create(c2, "TY", "22")
154+
),
155+
// 创建出两个节点之间的边 TODO 在这里使用的是字符串,因此不需要使用 Cell 类的构造包装。
156+
Graph.GraphEdgeDF.create(
157+
// C1 <- 前任 -> C2 代表 C1的前任是C2 C2的前任是C1
158+
Graph.GraphEdgeSeries.create(c1, c2, "前任")
159+
)
160+
);
161+
}
162+
}
163+
```
164+
165+
* 针对 DataFrame 以及其有关的模块,在此次更新中,将使用统一的序列化版本号来实现序列化操作数对象在不同版本的AS库被重复解析和读取的能力,拓展灵活性。
166+
167+
```java
168+
package zhao.algorithmMagic;
169+
170+
import zhao.algorithmMagic.algorithm.OperationAlgorithmManager;
171+
import zhao.algorithmMagic.operands.table.DataFrame;
172+
import zhao.algorithmMagic.operands.table.FDataFrame;
173+
174+
import java.io.File;
175+
import java.io.FileInputStream;
176+
import java.io.IOException;
177+
import java.io.ObjectInputStream;
178+
179+
public class MAIN1 {
180+
public static void main(String[] args) throws IOException, ClassNotFoundException {
181+
System.out.println(OperationAlgorithmManager.VERSION);
182+
final ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream("path"));
183+
final DataFrame sfDataFrame = (FDataFrame) objectInputStream.readObject();
184+
sfDataFrame.show();
185+
}
186+
}
187+
```
188+
189+
### Version update date : xx xx-xx-xx

0 commit comments

Comments
 (0)