设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14365|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 j% Y/ ?, c/ V

, s: y" h- v: N% R4 n& q; S  ^2 c我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。, [* n& d( J% h* I( Y

7 \* n& h( \$ U: ?7 w; C/ Ibegin P_read arriving
" ~6 ]/ l; c1 ]7 V    while 1=1 do begin5 E2 z( e$ L, v
        read A_tote from "data.txt" with delimiter "\n"
8 |, E  d5 @9 U# W$ e/ O3 Z9 d+ \        read A_time from "data.txt" with delimiter "\n"3 D( N! `) b4 h/ e' G: A. o
        read A_leave from "data.txt" with delimiter "\n"1 N+ B3 [  Y3 d; v, i
        read A_picks from "data.txt" with delimiter "\n"
1 ^; h& z+ G5 O" ?& u) m  `6 E7 v        set load type to A_tote' o' Q( x. \) l, G
        if A_tote="tote 1" then set A_induct to 1" T2 J* K: s; Y  w# N: N* L& B0 r
        else if A_tote="tote 2" then set A_induct to 2
$ t6 ?6 q  a: z$ \            else set A_induct to 3   
/ _) t: [3 `7 a- ^, @' W7 P: B9 W        set A_i to 0
% k6 d3 H) w4 [, t        clone 1 load to P_induction* e! Z) o1 T5 M9 A
        wait for A_time sec
: h6 a: ^) ?; P8 g    end
8 |0 D: Y: H  ^, L( Z$ I, [end* G0 ]: A3 A: `& G

- J. |2 e6 j. u6 N6 K" H& [begin P_induction arriving
- f" G9 I3 p) t, K( Q    if A_induct=1 then clone 1 load to P_pick19 p2 V' K0 T- Q: u5 x' x# S9 F
    else if A_induct=2 then clone 1 load to P_pick2  a3 O5 ^  E* {" l% H
        else clone 1 load to P_pick3
' x9 e) P4 F3 D7 pend% T9 B  k# _" P5 z' e+ e$ ?

4 @( L8 y! L+ _2 X5 i$ a! |/ G/ c- fbegin P_pick1 arriving
( p  `" V+ r  g' n2 P6 z; a# R  ]    set A_i to 1
9 a2 B1 T( d0 W0 {# {% t    move into Q_induct1* K0 g/ M: C3 {
    move into pickaisle.induct1
; F% F1 ?- K, ^  b; J6 c    while A_i<=30 do begin- q2 Q) F9 @" G# s
        travel to pickaisle.con(A_i)/ W: w) Y. e3 y+ [; T1 I2 n
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 q0 U, e& T% Q1 s' J
        else wait for 10 sec% ~1 N% ]! j  ^. R
        if A_i=A_leave then send to die
  v( y# Z- p. \        else inc A_i by 1" O3 \) J) @2 `7 p7 i# l( ~
    end+ u4 \$ Q4 g+ s
end
8 l# A, U9 h7 r' W& a: s5 w3 X3 c
+ J' K/ w- Q0 u5 E6 Z2 }begin P_pick2 arriving
' c. m: W) b3 o, p! L; x( m' }  h    set A_i to 115 L$ y% r5 i+ x3 `# G
    move into Q_induct2& ~# a7 ~" P( A! C2 \
    move into pickaisle.induct2
  J+ z; K1 e1 @% h( x7 A    while A_i<=30 do begin
% ~; _  A2 m# r5 X1 o        travel to pickaisle.con(A_i)
9 f$ i# j) U* r1 Y0 F7 f! l) a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, `, k! h5 F; o6 I) s        else wait for 10 sec
0 d5 V! a5 `5 f        if A_i=A_leave then send to die5 O1 i9 e. r( W# U. d# L/ c
        else inc A_i by 16 m. i5 T7 \1 G
    end- s" M9 x7 W* D' |
end
2 }4 K) |0 G- f. e: S' [
; W* e" {4 @! u' j" ?, }begin P_pick3 arriving
  [; i( \! V; C# a    set A_i to 21
7 N$ u8 X( e& B3 d    move into Q_induct3
, \) u& [0 ]& l! T3 M# M    move into pickaisle.induct3
5 K0 ]7 s  n8 m( l6 H8 x! H    while A_i<=30 do begin
) I  _/ T  V: q, i) ^        travel to pickaisle.con(A_i)' c: g- Z( f, h; y- J1 g) \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 k# ^- N' M1 ]$ [; [        else wait for 10 sec. q1 q& l2 \0 o+ y' f
        if A_i=A_leave then send to die
5 C$ A7 X5 L: k0 {" b' E9 h* L$ X        else inc A_i by 1
* p1 M+ l- {( y; `    end* y$ B" [+ s7 R9 S9 K
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
1 G& ]/ `. s) U9 ?- m7 Lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 x- g/ Y, E$ m/ |9 r8 w
$ A. x0 h- X$ P+ gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 c; ^1 d3 A* \8 i
2 J) Q" z2 r+ R& Y4 G# T  n另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1 A0 q. b$ ?2 k1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2 z. s0 }  Q* p' k. ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
8 @' S# f! z. n$ n3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) u) @4 @# f1 P
begin P_induction arriving: L- H! M% Q$ r7 c4 }% |1 G: p
    clone 1 load to P_pick(A_induct)
( l" d+ _# b' n  z' Y( e- h& Y, ?end最大的系
, A  w. c  O  l2 l) z* L' G/ f
" H* V. o  ], [4 Z+ Dbegin P_pick arriving. y% @) E" v2 K& P# \
    set A_i to procindex * 10 + 1
! M2 g& _8 `$ T& Y$ s; D    move into Q_induct(procindex)) c* q9 O7 w3 \7 L- n- L" e# [
    move into pickaisle.induct(procindex)* s# ^7 q8 @' H+ u2 G& u
    /*check the type of pickaisle.induct(i), for your last problem.*/" j. b/ |; v3 w

- b. w. n3 g1 I* t9 \8 U: R! U    while A_i<=30 do begin/ j1 V6 H8 k4 ]# s5 P7 n7 n# V7 t: {
        travel to pickaisle.con(A_i)6 I# X# ^5 a# b7 J2 r8 Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% f! f  p! H1 `6 n; v        else wait for 10 sec
- k3 ]/ e' A) v% d/ E' ^        if A_i=A_leave then send to die
2 @+ K1 P4 ?8 r3 G0 N+ }' g        else inc A_i by 10 y; ]# E. W2 q; F' h7 z$ L% p
    end
, e. W2 L% t1 L# Z; Wend) H5 j3 ]1 S' o3 k. r! o
9 y: R' k" M# b0 s: ^
其中的procindex为整形,代表当前process的序号。
+ F# @: M% P5 I. Rstation和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-7-6 14:23 , Processed in 0.014296 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表