设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12661|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 C# E! I1 ^: U8 U" a4 z7 `$ D" t( b% C( 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中的数值,不知道会不会有什么不妥。
! Z- m# I5 w; P5 J% e) _. N3 q3 P9 U) X- ~' Z
begin P_read arriving/ s& t+ a* U( }* e
    while 1=1 do begin0 h# F, d, o& ^: n) E9 d
        read A_tote from "data.txt" with delimiter "\n": S+ C/ `8 O7 L
        read A_time from "data.txt" with delimiter "\n"2 y9 _: [, N7 l1 F9 {- Z
        read A_leave from "data.txt" with delimiter "\n"
8 A- u$ @8 p. I- [: n        read A_picks from "data.txt" with delimiter "\n") s* W. |- Y, c, E2 i3 p, S: N% D
        set load type to A_tote6 d7 t8 S. N: N; T7 N
        if A_tote="tote 1" then set A_induct to 1, L8 w- n$ b! P# V$ D2 B
        else if A_tote="tote 2" then set A_induct to 2' X+ g* c: d, C- _& T& Q/ d
            else set A_induct to 3    & B# U* f( y& E% d
        set A_i to 0
: L, \+ c: q* t, d! n/ E" b% a7 j        clone 1 load to P_induction. a! x4 Z4 H* `6 @! o
        wait for A_time sec
& F% Z& S3 ]: y: u9 }8 e  O    end! e/ O! X5 q3 J! M, B
end7 f/ p+ r: s+ k: V

+ u( P4 g* t% P1 bbegin P_induction arriving
! Z8 O4 j) ^* y$ l+ \. {& N    if A_induct=1 then clone 1 load to P_pick1( G9 P, Y# h1 G0 E+ |
    else if A_induct=2 then clone 1 load to P_pick2  H0 Y# P! w. }, F
        else clone 1 load to P_pick3$ `8 ]( s' D/ c
end& r) Z1 k+ p  ^/ s" h7 ~% [* ?
; k4 {$ h' g" F6 J, `, A2 W0 u! W3 Z
begin P_pick1 arriving! v. T- g) r" q4 O: j
    set A_i to 15 J# `* q9 G8 X- W6 v5 z
    move into Q_induct1
/ D: x* V1 g) x1 I+ y2 p* N    move into pickaisle.induct1
) X3 M8 D& e% Y& q. o6 x5 Z; k    while A_i<=30 do begin
$ A" J- g: B/ W  u        travel to pickaisle.con(A_i)
' c, P$ c5 s% P2 c3 W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- A1 m! o% c7 Z5 j: g4 @4 h
        else wait for 10 sec
: `! k8 e' n' g/ V1 Q6 q9 c        if A_i=A_leave then send to die6 @# ?+ Z: w; A' Y2 _1 g
        else inc A_i by 1
9 c% ^$ X/ x: T$ O. \2 @  j4 S    end/ u- I4 d* C: T; C5 _
end
" z5 E/ H# R+ q  H  P& x' A) d3 O! |% Z( o  E+ e- j, |6 T8 k2 H
begin P_pick2 arriving
" h, ^% l5 R9 Z' a    set A_i to 11
! r) ^/ S% q' R1 c  q    move into Q_induct2
& |+ H. W% i8 W7 M' M0 V    move into pickaisle.induct2
7 r- H. o, c7 T7 g6 V  `  z  o    while A_i<=30 do begin
5 X7 ~  W" A2 W  v. h, ]6 Q: s( t        travel to pickaisle.con(A_i)
  E' |/ W8 ]9 V: X2 @; D9 j; L5 S        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: t, k3 _% S. i. B7 |& ?3 c3 i4 H6 E
        else wait for 10 sec' I# f/ t- u. |5 {3 A3 O$ j9 z
        if A_i=A_leave then send to die
' @! ]7 f2 q7 A9 M        else inc A_i by 1' p  o3 p9 {8 H1 ]# R2 x
    end, Q5 t& p/ X3 I( a# r" Z* L1 R8 M( j
end+ T* ~# K( D$ ~1 F1 @7 A# ]7 M
3 ?! Y( F0 z' G1 L& _, @8 V
begin P_pick3 arriving2 J* K9 X" E9 w
    set A_i to 21
# |$ ^* g) N0 }1 I2 H5 A4 f3 J    move into Q_induct3. @# l, X' T1 u- u( K' ~# V5 u
    move into pickaisle.induct3. o1 s2 D8 [' x( z' {4 N' ^
    while A_i<=30 do begin
8 L/ C- ?* F/ c( ~        travel to pickaisle.con(A_i), p9 b3 Y1 g) ]3 r4 w
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' x' m6 {7 r4 |; J. L9 T' _6 J
        else wait for 10 sec1 j) d3 a9 s# X! r
        if A_i=A_leave then send to die
! y) J7 h& k5 h; S        else inc A_i by 1+ ~' x! ~5 ~2 m/ v. u
    end/ ]) B# s, {2 {
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是个什么东东?: w9 p/ z9 V' d
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ g) L6 s* q# C, B3 U8 p7 }
- Y- ?$ q0 ]: T  v* V* Y, C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 I9 d, w4 i& n1 U1 M
$ P9 h9 X% E7 M0 P# y, _另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& j: n2 K$ ?9 |" M* K. W: o1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 p* C9 K$ c  u$ ?0 U) F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
4 b2 Z# a9 ]+ z$ |+ G+ x3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:# k( P3 l/ l0 B& Q6 u& P
begin P_induction arriving
9 A) v8 F' Z# X    clone 1 load to P_pick(A_induct)
& R8 {' K% G) a: h8 q, C6 B# Pend最大的系
( {( W# J- y( l. r" O
, D1 p6 j: X/ ^: C- |2 X$ Wbegin P_pick arriving
. `) F  T7 U* X# A% k7 b    set A_i to procindex * 10 + 1. U/ t$ [" Q# a
    move into Q_induct(procindex)5 _7 X+ r% t, v1 p) N' T
    move into pickaisle.induct(procindex)0 L5 n  H: X7 e" W
    /*check the type of pickaisle.induct(i), for your last problem.*/8 z. F; f- W9 x. X0 n& Z

  A' `% L* Q9 n' d6 n) |    while A_i<=30 do begin4 V& j  ]& w* X9 X
        travel to pickaisle.con(A_i): k% ?7 z3 m  F$ l2 [) h+ w0 f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 T1 B  J2 X( e( A1 p, L) ]$ v! n        else wait for 10 sec8 {, [' o+ B8 n1 l" Z
        if A_i=A_leave then send to die
  T0 Z1 m) c! S        else inc A_i by 1" b3 O" `3 l$ D( M9 @8 T4 |3 k
    end) k  S# ]8 c% h( t6 M0 W
end
- s. O3 \% l, y3 ?: Q  A5 p
+ G" w, a: v: E( E, C其中的procindex为整形,代表当前process的序号。2 `2 ^$ ?0 ~6 o4 {
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, 2026-2-8 23:03 , Processed in 0.018925 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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