设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15158|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ _+ F4 }4 W& ?, R( }! d0 l& s
" j) g. k% G' k( v# _6 L, A9 D  M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 z1 x; R! F& p: a1 Y2 S

5 ~  S4 C) m$ L. F3 v# R# z) Obegin P_read arriving) S4 |) A$ i3 V
    while 1=1 do begin
0 m2 O8 r7 j9 G/ ^) C+ V4 N        read A_tote from "data.txt" with delimiter "\n"
8 _# [: v% ?) R3 x3 S        read A_time from "data.txt" with delimiter "\n". {) ^7 f. t5 V
        read A_leave from "data.txt" with delimiter "\n"  T" }$ s8 u% ^1 V0 U, r
        read A_picks from "data.txt" with delimiter "\n"9 X/ _* e0 r8 E3 f5 h% f
        set load type to A_tote& r0 B- C. T  b3 @* ]
        if A_tote="tote 1" then set A_induct to 1
+ g# X9 A6 F0 s5 a& Y# n        else if A_tote="tote 2" then set A_induct to 2
; ?( m. w! e* U            else set A_induct to 3   
6 N' D- j  c" q+ ^0 E2 x# z: `        set A_i to 0
' Q: n7 r/ A& I  Q$ `        clone 1 load to P_induction( x' K* e! g4 Y; O
        wait for A_time sec, ~: Z4 h9 ~3 b2 ?2 A& D0 ?* B
    end2 z3 u. M' |+ W4 o6 L
end! X# g' k4 u4 k$ \, F% S

; ]3 K- q* {# ]- X4 g: g* Wbegin P_induction arriving
! P3 E2 F6 l1 d1 W5 p2 n    if A_induct=1 then clone 1 load to P_pick13 f$ H- \' E4 Q( [9 N3 f
    else if A_induct=2 then clone 1 load to P_pick2
) v% I1 ^/ \# Q: g& E        else clone 1 load to P_pick3
) [6 H) l) w, Lend, p1 Y* n4 S" `+ L  Q2 g$ ~
/ r+ F/ k2 W3 I$ x2 G- k/ x
begin P_pick1 arriving
  K6 Q  P  H5 ]6 a: A    set A_i to 1, A' }3 Z% I; b2 y+ T' v0 v
    move into Q_induct1' p/ q: U$ u3 S$ N$ a" P) r
    move into pickaisle.induct1
8 W, i; ]* z9 t2 U& I    while A_i<=30 do begin
( m# j) l- i3 z5 H# t/ I        travel to pickaisle.con(A_i)
6 \& d( Q. s7 x: H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ R0 u5 h( g" v, e2 N& [8 k) r        else wait for 10 sec: v6 M) I& T9 E# d
        if A_i=A_leave then send to die( {& u& d4 V' M1 y2 }6 }
        else inc A_i by 1
; T! }! P, d% P8 r- ^3 E' |5 m- t    end* y; `' `$ F" P8 V5 s
end
" t, M( v' h  ^4 a
: j9 Z) o0 `* Y7 z* ]begin P_pick2 arriving5 |0 A. _& A  V+ ?' l3 X" L
    set A_i to 11& R2 w. [2 E( z+ `( _& |) Z
    move into Q_induct2
0 `# W4 l* U$ w7 O2 E1 L+ C% [" i9 O    move into pickaisle.induct2
' Z& u, M* u. C    while A_i<=30 do begin
: p: i  z; }3 j: D        travel to pickaisle.con(A_i)# |/ @' l& q" ~, S# H& G/ j& {
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  P; a. s% M" ], e/ F
        else wait for 10 sec% x8 ?5 j: R4 U
        if A_i=A_leave then send to die- q/ v. U/ i  ^2 |% J( K: r% p% Y- }
        else inc A_i by 1% v) Y, L/ K: H0 ]' W$ H
    end( g! p0 c4 A5 C2 H7 A% S0 u: ]
end- V8 I. n/ q' h( ~2 B
; u- u. o' P2 J( D
begin P_pick3 arriving
( u: {: o; ]5 X4 ?7 @    set A_i to 210 N8 ]% G5 R1 X4 {
    move into Q_induct3
& M+ U7 Z5 r1 C* \  m    move into pickaisle.induct3
. D4 Y4 d- R6 x7 X0 b! U    while A_i<=30 do begin
) B7 H3 N) A% U( z6 c* z- i        travel to pickaisle.con(A_i)  w9 b- i8 Z* Z7 K# A6 Z8 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 q/ ?: ]# T. @6 B
        else wait for 10 sec& y) p( ~4 ?0 Q9 H' f- D" ?( j
        if A_i=A_leave then send to die0 H1 @3 e$ o8 s) k8 ?+ `
        else inc A_i by 1# s, _1 U* z( W, c' y+ @# P0 D
    end6 K3 |9 K% c9 W& P0 B
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是个什么东东?
0 G3 g. G3 H; ?' Kmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ t+ j1 _- \" ?$ l9 Z& }8 t
1 O1 U/ Q5 j% N2 k! Q+ ~  M, |; VAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
! Q; r6 a3 {, \; x# y9 i6 B) D; k2 H; R! p3 r/ F" r
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:8 p& x. \" j# H
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;  S& r, T3 d7 j# o
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ M: n! A# D- O+ O! h6 T; N3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:6 H# l/ A% `" P. m7 Z" f/ C
begin P_induction arriving+ J' I1 X/ F2 X! t1 Z$ N( n
    clone 1 load to P_pick(A_induct)9 j9 h' z* ?8 ?0 J" x% x4 n: K
end最大的系8 E, P9 N: X/ M5 F: E

$ Q: [% U' l9 `- r! \* i+ Tbegin P_pick arriving
6 _6 H1 s3 m/ u% Y1 T! J    set A_i to procindex * 10 + 1
3 v+ V# F0 F3 y6 g) u, Z. |# l    move into Q_induct(procindex)
* F2 h3 J( b1 ^    move into pickaisle.induct(procindex)6 J8 S, ?: I  }
    /*check the type of pickaisle.induct(i), for your last problem.*/
; e* l. x2 n$ x0 j/ d
/ V' w9 n, p: f; t! M' F    while A_i<=30 do begin- I  s: Z9 `' |8 i8 [( h6 \/ s- [: m
        travel to pickaisle.con(A_i)6 @! a% {1 `8 d/ [; ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X- O0 j5 o5 L        else wait for 10 sec
- ^) |3 s1 U% @- }        if A_i=A_leave then send to die
! b$ w5 ~/ e0 y; Q/ u+ M& |        else inc A_i by 12 C' h; D" ^0 [( x  E& H4 C
    end
( }+ U& ]; E3 Y3 G& ^: j3 Vend% c9 f1 J# x5 d1 K. ~5 @$ U- r
$ q8 t) I2 j7 X1 u' K8 w0 ?
其中的procindex为整形,代表当前process的序号。
, a* H! {  ~/ V, N1 X" u) Gstation和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-8-17 03:26 , Processed in 0.016681 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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