设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12097|回复: 2

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

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

4 @* V+ F4 R1 l5 l我的问题是,在每个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中的数值,不知道会不会有什么不妥。( X6 \7 T! _. }7 j
3 d4 p7 b' y7 n& [3 g) x
begin P_read arriving7 c+ {) [2 Z4 ]( r; ]! q% s
    while 1=1 do begin
* M8 Z; {' K3 b% _; i        read A_tote from "data.txt" with delimiter "\n"
; S1 B+ Q0 o# j, C' ^9 |: b        read A_time from "data.txt" with delimiter "\n"
, I! R- _" B6 p/ |8 V        read A_leave from "data.txt" with delimiter "\n"/ O: U  n1 w( C* j" j$ d1 ?; l0 S
        read A_picks from "data.txt" with delimiter "\n") a. }7 Z  m! T, K. A
        set load type to A_tote
7 W7 D5 x7 Q( T% X2 Y  W        if A_tote="tote 1" then set A_induct to 1$ G3 B/ X: ^6 C' i( M1 f
        else if A_tote="tote 2" then set A_induct to 2% r3 p3 v( A/ X) I! b) e$ K
            else set A_induct to 3   
7 n% y9 j3 w0 j6 n        set A_i to 00 s4 t; R& P( c$ j; n: ~
        clone 1 load to P_induction
# {+ F( a( e+ X8 Z' k+ |        wait for A_time sec
/ y% G* Q: P: s0 B+ k    end
8 w) L; m" q1 y: pend. n* ^+ A1 C: L; H3 Z  J

9 Q2 G- W: T- j6 m2 cbegin P_induction arriving2 V2 t8 w* j% v; _" E  G, f7 S
    if A_induct=1 then clone 1 load to P_pick1
! ^  L5 V. g/ ]( U% J    else if A_induct=2 then clone 1 load to P_pick2' `8 h/ b5 a7 p, ^1 L
        else clone 1 load to P_pick3
  l' Q$ [* U8 Mend
  _% N5 P; Q4 v% t, h0 F/ G7 c* \9 s
! g" w& H$ y- g# w( h) qbegin P_pick1 arriving
0 K0 b' F$ }7 _/ E4 j    set A_i to 1
' d. W! w; c0 r9 o2 f    move into Q_induct1
* k; |8 \) k+ i7 Y    move into pickaisle.induct1
* r, U9 r: w5 p    while A_i<=30 do begin
5 p. H- J0 b0 [9 u9 }5 X        travel to pickaisle.con(A_i)6 V9 x& T* \! l6 r& a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* \' U1 _' P1 W# q% _) A- I# `- j        else wait for 10 sec( T- I& P: P' q) W
        if A_i=A_leave then send to die7 m4 H7 l7 P/ \+ w# r! s# p
        else inc A_i by 13 |/ \# U2 a0 p" V  J# D) F( F
    end
+ K$ P0 R- B% w4 l+ T) \end, f. _& S3 R0 N6 ^) A8 @3 B$ C
! V9 ?! y. Q1 h
begin P_pick2 arriving  E6 r0 R6 g7 a  k) a0 _2 G5 d- t
    set A_i to 112 h$ W) R* k$ h0 A4 O+ m
    move into Q_induct2
& |  ^) F; m! h* \$ \    move into pickaisle.induct23 f# {  J1 B0 j* a. K
    while A_i<=30 do begin( n3 c  C& {" V9 [* h: x7 ]
        travel to pickaisle.con(A_i)
: H7 x4 x; g) U& [8 W" ?. N        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, O2 W! J5 e" U$ u, v        else wait for 10 sec
: g: s, ~, h# D* _1 @        if A_i=A_leave then send to die3 }  \: y6 |3 S. c- y4 B1 u% R
        else inc A_i by 10 d* Q6 Q$ I% T8 j+ _' k
    end$ ^$ J' }, a6 S# \' J
end: U# y1 J) K* D4 }" @. D
& |/ L/ `$ R& m
begin P_pick3 arriving) t9 t' }6 d8 |( o6 s- {
    set A_i to 21
2 L; d3 F2 C2 Z- Q7 W" _8 O, k    move into Q_induct3
& `6 i( S% r% A. O4 J; X    move into pickaisle.induct3
; q! ]6 S1 L0 J    while A_i<=30 do begin3 N; I, i7 b" q" ^2 @5 r
        travel to pickaisle.con(A_i)4 L) Y5 A! X4 L! S' F, V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 m$ O) ^; p5 d, Q8 I
        else wait for 10 sec
4 c( h" i; o4 X2 e/ b        if A_i=A_leave then send to die- s  G4 T2 `- \7 q6 s
        else inc A_i by 17 i. e/ w) ~( A
    end
  \- X5 [: {" G/ z) Yend

最佳答案

查看完整内容

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是个什么东东?
/ D' e) |/ D; R- ~2 b# c3 E  C: Hmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?* ]% N7 ?9 W9 z) q. ~* N4 O
6 ~( i$ i0 C5 P1 A; ]
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。$ y' E. K5 T9 {
: a; u2 t7 Q8 p3 z7 I, W% b" w- e8 |& {
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 f1 ]; j, _$ E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
  H' c" `2 r0 b) ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, U2 Z: u5 v: ^3 f4 j& N4 e0 ]3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
3 |/ r" |. ^% X% obegin P_induction arriving
) A8 C" D# x: W1 K' O9 N- n    clone 1 load to P_pick(A_induct)
/ |0 J; N7 L/ f' B& y/ Bend最大的系
$ E/ j# ?- B6 N
* s' Z& R# a$ ^# ^begin P_pick arriving
# V& I, I9 ^$ r4 Y" S    set A_i to procindex * 10 + 1; X' g- p+ E; a1 I0 S% D' b
    move into Q_induct(procindex); {) n# n( u3 ~) F6 M( a& D4 B
    move into pickaisle.induct(procindex)" a2 M! i+ f% u3 `, g
    /*check the type of pickaisle.induct(i), for your last problem.*/, o+ ~: E8 x: \( H
6 Q/ b; r& e$ U- N! v( i. x
    while A_i<=30 do begin/ ~9 n, V/ _" {
        travel to pickaisle.con(A_i)
2 y- q3 a& y9 N6 j6 t$ O5 z3 ]: l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. _- ]) b0 s1 V- u( p0 n  e        else wait for 10 sec3 ~8 t! u% k  M# v3 ~+ Y: b
        if A_i=A_leave then send to die3 o) }$ X# ^6 w! `4 p
        else inc A_i by 1
( F  q) f9 B9 r- f9 g    end" P. H- p: E) A# y6 i
end
: a! S& H/ T3 v; `# }6 n  `* D! Q+ x
其中的procindex为整形,代表当前process的序号。
1 p/ M! p. P3 C" Ustation和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-27 15:09 , Processed in 0.024825 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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