设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15556|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; Y  k3 p, u6 r) Z9 z. e! w9 V5 z
; |( I: n* V5 K+ p
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- H0 u" D8 [& ?0 S) N0 N: T& q
/ ?! N4 X' b1 Y" C) lbegin P_read arriving2 ?3 }/ W+ H" _# l
    while 1=1 do begin
& r7 ?- R& f8 d  l& t& w        read A_tote from "data.txt" with delimiter "\n"
4 e0 Y4 n+ ^# y, h# ^5 b7 ]        read A_time from "data.txt" with delimiter "\n": C- v6 e% T* _# N3 ^/ K1 v& z, z
        read A_leave from "data.txt" with delimiter "\n"
; J0 e! ~  w1 f: I9 e' v# e2 L        read A_picks from "data.txt" with delimiter "\n"9 r2 d2 G0 W# t0 p$ b$ ]- j
        set load type to A_tote" {5 m' E5 j9 M7 m+ h, U0 {
        if A_tote="tote 1" then set A_induct to 1* q/ n2 O8 u' V! t5 K
        else if A_tote="tote 2" then set A_induct to 2) z: f; t! V) U! x
            else set A_induct to 3   
& T1 d, ~2 Y  \  t        set A_i to 0
" w& S% e$ |$ j7 `* M        clone 1 load to P_induction
! `. h# u) S0 H        wait for A_time sec
$ d. f" R4 [  u8 U    end' C6 T8 C9 u5 P+ v
end0 _% B/ ^4 ~# U/ P% ^- Z0 [
6 F& ?; V# W$ S& H
begin P_induction arriving
$ ^& p1 H- [8 \' w0 ]8 H! s    if A_induct=1 then clone 1 load to P_pick1* ]  a5 \" a- e# I& {1 H! ~) \
    else if A_induct=2 then clone 1 load to P_pick2
& |* A9 x0 o7 s) A. p  C- X/ {/ y$ f        else clone 1 load to P_pick3
4 i/ n& t. Z- iend
# {* K  l8 j& O2 U5 w9 A, R- N% B# f/ c) G1 t- ?% y* L
begin P_pick1 arriving
; n9 C  W+ a7 L) b$ B# ^    set A_i to 1
' f8 J7 v( {0 |/ H. s1 t' x- [" x$ L    move into Q_induct17 X: n' Q1 U% w' G
    move into pickaisle.induct10 T* r2 o  B5 Z4 J( f/ N1 X
    while A_i<=30 do begin+ B& [- j& i/ o
        travel to pickaisle.con(A_i)1 Y9 s3 ]3 l- D% G. A- S% G
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 I1 i5 X5 S% H: q        else wait for 10 sec
" x" y* d1 F2 p4 F        if A_i=A_leave then send to die& A- f- j! E  t* z# [$ ?+ t
        else inc A_i by 1
+ @2 }1 M, f# O    end
+ O# Q- Z' U/ R4 M) U. |end
; @& ?: Q/ K) j$ _/ D' ^/ @/ u5 E. V' j! ?4 o# w% g. S$ z$ T
begin P_pick2 arriving
1 x# i: {. f- b3 z* N0 g6 E    set A_i to 113 m9 B8 V" Y! n' J" ?/ j
    move into Q_induct2
8 {9 A( }; T% t) Q3 E, E+ h    move into pickaisle.induct2/ Y9 }  o# u' @2 ?" t
    while A_i<=30 do begin4 F  `3 ^! l  a1 N/ D
        travel to pickaisle.con(A_i)
1 u. F: X( |8 R7 j5 o& _/ h' |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% E: d( v& t; A1 C
        else wait for 10 sec# `0 P+ a7 q4 z5 ?  F
        if A_i=A_leave then send to die1 E9 r! z$ C, J2 k( N$ @
        else inc A_i by 1
+ ^+ S9 |) ]% n0 C- j    end) l+ G, b& `  T( F& a  _
end
# m) G" _! c. u( U# k& }1 `" Q* d; P" }; t. f
begin P_pick3 arriving
  c8 N- U; T0 W. |1 R' T6 l9 n5 D    set A_i to 21
+ a" O5 r' h: \6 @    move into Q_induct3
- g% Z1 U5 U7 z8 Y    move into pickaisle.induct3. w% d/ F' s6 S; F- T2 W5 E% Y
    while A_i<=30 do begin
. d$ a0 B  t2 o; L        travel to pickaisle.con(A_i)
( h0 l3 L# r) s( x7 R% \+ p. ^, p        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 z* K0 w4 S& ~( ~! C& V3 I* G
        else wait for 10 sec
0 Z6 S! J/ M1 i! N4 A        if A_i=A_leave then send to die
, P0 p2 ]% e0 E" v3 {$ Y        else inc A_i by 1
6 O3 a' x& S0 M& I7 n6 I. N$ g    end! x  h+ R+ s2 l# _
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 z' O1 i0 K/ I2 o! m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?0 D" H' S8 Y: d/ S% F- A, g
4 G: l5 \% D0 k, Y/ L& J  I" a$ f/ s
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
# Q) C% `8 d# n+ d! ?9 g0 Z4 {! @1 U$ a, k) C
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 T( G1 \# L) K1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" y  I9 Y/ V9 u5 Y  s! x
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 `- ~2 }" _( V$ ?( D/ K
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 Z/ A+ M$ @8 Q; i) n  l4 l" r2 ]
begin P_induction arriving
+ z2 }3 Q& e5 C7 x3 H    clone 1 load to P_pick(A_induct)0 i. K9 @; G3 g2 H/ I
end最大的系
0 t% ^8 Q" l4 Y( ]2 z6 |4 W9 ^% g4 l, [9 ?
begin P_pick arriving
) N0 t9 @% h( x    set A_i to procindex * 10 + 1
* ?) O8 Q7 T$ P% C: V    move into Q_induct(procindex)
: p# P. ]) b$ B) e# i7 ^    move into pickaisle.induct(procindex)
0 h( \- A. v( `+ T    /*check the type of pickaisle.induct(i), for your last problem.*/+ q' \; O3 i5 W3 r- E
7 A* Q  F* Z  T4 Q. o: {
    while A_i<=30 do begin5 s5 K2 k9 F, P3 Y8 _9 ?
        travel to pickaisle.con(A_i)
3 K/ x# ]6 k3 [& n# ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 E0 n) N& V& P7 O2 d% m
        else wait for 10 sec7 `3 G  Y2 `( Z$ P) k/ h6 s; G2 E
        if A_i=A_leave then send to die
. K+ W& s: X1 b5 L9 u  T* o        else inc A_i by 18 Z" j- i/ A. ~8 G
    end
1 f( ~4 ]( K( _9 m# R2 y$ S/ gend6 I, k8 d1 x9 k  s
  B$ D( F! J1 W5 W) ?: E
其中的procindex为整形,代表当前process的序号。
. \( H: j8 x8 e# 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-9-20 02:39 , Processed in 0.017052 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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