设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11761|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ U& h3 L+ a  A8 [# g% H  o' S2 W, E* i! l6 M: Y; a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! q- v" ^- m" c6 N
3 q$ W' |7 G' C# Nbegin P_read arriving; N; V3 [9 F: W& [& n* s* G* L
    while 1=1 do begin
  n) V7 z' g$ t6 O" m        read A_tote from "data.txt" with delimiter "\n"3 m6 O. u/ }9 r2 _' {
        read A_time from "data.txt" with delimiter "\n"5 e6 A" [: w* @1 q
        read A_leave from "data.txt" with delimiter "\n"% y7 f0 N! Y- _8 k1 b# p6 k
        read A_picks from "data.txt" with delimiter "\n"
1 `$ K7 M! I8 A" I, D        set load type to A_tote
/ Q* \: ^. Q8 _6 \  o2 a- M        if A_tote="tote 1" then set A_induct to 1
- M( i9 j8 t; i# b7 e, b) A4 m, J- `        else if A_tote="tote 2" then set A_induct to 25 v" W3 _: c5 q4 m
            else set A_induct to 3    ! }  I5 |5 F# n( H4 s" k7 T  B% S
        set A_i to 0
! c+ Z2 a1 f4 B& c7 c  e$ g( E        clone 1 load to P_induction
8 K! z5 i8 }  N0 |        wait for A_time sec
, k6 r7 a  X% B* I5 A" I6 e    end  v  G. a8 n, i7 |8 C
end! A& U! m& \( c& D

/ r4 ~0 a) \* I2 d! `4 Z8 hbegin P_induction arriving
. ?& F- L* n* X0 v    if A_induct=1 then clone 1 load to P_pick1) H" L: o  S2 h1 P
    else if A_induct=2 then clone 1 load to P_pick2# k+ S5 L& B  x& C2 G" Y$ A
        else clone 1 load to P_pick3
- z  H' P) a* [- ?end
; S; r! I& n# z0 u! X+ x+ w/ `' x7 `1 c( u7 W+ @
begin P_pick1 arriving$ k0 o- P# t6 d- v1 X
    set A_i to 12 _9 W4 B2 H: K+ {0 i' M4 s
    move into Q_induct1
# u+ C& z3 d& i3 D    move into pickaisle.induct1
9 `- {6 ?8 ^) P0 n  P  k    while A_i<=30 do begin- E, ?) i7 b9 B! J# O. G+ V
        travel to pickaisle.con(A_i)' l* Z) e$ s5 o' j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% o4 A/ K- p, ?( _* ]* a! b        else wait for 10 sec
/ Y# Z  ~- M4 ~3 i        if A_i=A_leave then send to die
( \; ^3 n: G0 \        else inc A_i by 1
3 A% {: E/ Z7 v* N+ b& `5 |    end3 m, F5 b% r1 t3 Z( r
end
; b9 s- T" [6 e, m! R5 j% q! z7 x. t  u' V  j3 Q
begin P_pick2 arriving% o, M6 t! G' w+ I: G% d: T# K
    set A_i to 119 V* n+ {8 E4 Y/ B$ I/ E8 y
    move into Q_induct2
, v* ~# J2 r" O. a" o( v0 C    move into pickaisle.induct2, s0 F% O5 \, Y/ P6 E4 U
    while A_i<=30 do begin: n% a3 ?: \- Q0 |
        travel to pickaisle.con(A_i)
% z. f4 h# q* b6 b0 N: t$ ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( O- a9 t: |; o9 T8 B
        else wait for 10 sec. [, e6 [9 a$ E9 v9 F5 q+ n! {
        if A_i=A_leave then send to die1 c# a. b; U! c  {: V2 v
        else inc A_i by 14 p5 g6 _1 L2 R6 b/ J0 ~- P# @* D& T
    end
6 a9 r; u) `; X% O, zend: E3 a5 {% b: \; k+ E6 q% l. J
; ~: l9 u9 m1 M8 P$ D9 V
begin P_pick3 arriving
9 S' @  P, C) O: z    set A_i to 21
! Y7 N2 `6 b8 R% U2 N/ m  X    move into Q_induct3
. P; _; V. o9 ]- X; `4 y) A    move into pickaisle.induct3
3 R+ s" X( ~" p+ Q    while A_i<=30 do begin2 f; ~! U: h: Q/ x) [7 c
        travel to pickaisle.con(A_i)* n! A) A+ ~% O0 [, E
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 o* V  a- y. `1 L' A. ]( L7 ]% L* j
        else wait for 10 sec
% U2 U3 b- x3 d; A" \+ X7 \2 h        if A_i=A_leave then send to die, }0 _+ [5 I+ L/ J8 C
        else inc A_i by 1, D/ p  M/ p: {
    end1 d# j0 E9 T# n. G! d3 _7 V* B; b6 s
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是个什么东东?* |9 ]! X- n+ ]8 N1 r1 }& }7 _3 q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?# P% i$ \3 Y3 I: c. |. Q
' C+ e7 o, R4 T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% X& R# a5 }/ T, W* {2 V: {' v: z6 [; L
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ e4 t  Q9 C3 _- r# k4 l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
/ \3 }% T. v/ \4 s+ r5 v3 z6 ?2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;# R" h$ _; F+ H, v5 f3 ^( I! G# ^$ Z3 X
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 W# \/ F# W) @) Z0 H9 z: Q! Hbegin P_induction arriving! n0 w& w3 V- j3 h+ u7 q7 i) q% P. p
    clone 1 load to P_pick(A_induct)$ L0 I$ W8 u+ V0 o- N1 Y; d4 W
end最大的系
. I' R& M5 p% J- H' E+ g3 Z8 D8 V
2 B' m" k2 h6 J( F0 l7 `9 a0 cbegin P_pick arriving2 V! j, S- h) g
    set A_i to procindex * 10 + 13 f/ y& f8 z5 @$ y
    move into Q_induct(procindex)8 O# X8 A! _: O
    move into pickaisle.induct(procindex)
) u8 X/ i$ t# L' L* W    /*check the type of pickaisle.induct(i), for your last problem.*/5 N! s% L% a& j

8 {( l2 i+ l* \3 o+ K2 P+ \( P    while A_i<=30 do begin
1 E9 P3 R0 z; O, ?5 k5 G( _        travel to pickaisle.con(A_i)
- _! b/ @8 K# W( P) [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ a! ]/ u% ]/ L: }/ y7 C4 q8 |& i) \        else wait for 10 sec# Z" `3 w$ Q0 b! ~9 X) S7 w! x
        if A_i=A_leave then send to die
: b4 h  P' t# z) @        else inc A_i by 1
" x8 N4 Z: m: |7 C0 \    end
) B+ t: n! z+ [; D5 U$ x/ ?" \end" V0 c: Q8 p. r* s, B$ M$ h

) q8 `& M, i& Q; p其中的procindex为整形,代表当前process的序号。+ t% d  a! P" I- \! I/ x6 q7 R$ E/ a/ d
station和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, 2025-12-3 02:08 , Processed in 0.021978 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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