设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12695|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, U* t4 {- e$ e7 l& S5 \
0 p" j# u# P( 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中的数值,不知道会不会有什么不妥。# a" X2 h- B" W4 G  C( `" [
8 h9 N; H9 N' @- e5 I
begin P_read arriving
& y7 N5 H' A; C# v/ Q: U) s6 B    while 1=1 do begin
; \7 n7 S" E. N8 y  P4 _; A) u        read A_tote from "data.txt" with delimiter "\n"
2 L/ h$ o: B5 r        read A_time from "data.txt" with delimiter "\n"+ T' k' J% r8 z! Y: I& B  d2 @) ]
        read A_leave from "data.txt" with delimiter "\n"
6 Q+ U7 s# \2 ]* I, \( D        read A_picks from "data.txt" with delimiter "\n"/ M4 M3 }9 @# ?  o! Q! R6 ~
        set load type to A_tote+ E* E5 u( F% i( F) {
        if A_tote="tote 1" then set A_induct to 1
5 H% B7 d; b" }' F4 V! F! e        else if A_tote="tote 2" then set A_induct to 2/ o- K3 K$ O7 ^6 b6 A' x& q% o
            else set A_induct to 3    6 f) S# g) h" a7 [" H
        set A_i to 0
" G/ c2 Z: Z; o0 D6 i        clone 1 load to P_induction
$ g- }/ z' h; _' I) c9 Q' L  E* o        wait for A_time sec
5 h% g- C: V, D8 [3 R    end
3 d/ |7 v8 e4 X/ X9 t8 ?end
8 b  B, w5 m4 f" r# l; V/ |, Z& s
0 z) J$ X0 C$ Cbegin P_induction arriving2 F! `) I/ N  \
    if A_induct=1 then clone 1 load to P_pick1; P7 N: n- d) {; v* L
    else if A_induct=2 then clone 1 load to P_pick2
; K# ]2 n/ D# _        else clone 1 load to P_pick3
4 ~) F# _# i' i' t# wend) q- Y9 A# M0 u' [

4 @$ b: v2 U) R: a( e# ]- K2 Mbegin P_pick1 arriving; g8 S$ i0 w! O  N% g( H/ H2 {
    set A_i to 1" J; {( `) P3 W2 k" t) O/ d' O
    move into Q_induct1
/ n" j- m1 Q% X; G$ A2 n" Z    move into pickaisle.induct12 U3 `7 u" D3 f1 k8 x* N. {
    while A_i<=30 do begin7 |9 e& j# m1 T: T' l6 Q+ X
        travel to pickaisle.con(A_i)* }* J. n! x4 ~8 }6 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 V; q. N5 s/ M
        else wait for 10 sec* F" u6 X+ e9 Q, }
        if A_i=A_leave then send to die
- J4 W6 e* k. S# p" K) R        else inc A_i by 1
6 Q* G- b3 x% r; j# r    end& \' ?6 m6 q! `9 J$ A  b
end
3 [- B7 k  [+ T$ o1 t; S- Z8 Q- [+ j+ `- c3 v1 I. j
begin P_pick2 arriving$ q& k& c. b& _. s1 i, X
    set A_i to 11
: v# n  \( Y: S1 W9 Y9 N) i    move into Q_induct2% O5 [* j! X" ?9 v' X) K2 W* |
    move into pickaisle.induct22 c  B6 ~) M3 o" X8 p
    while A_i<=30 do begin# @% ~) f* {6 J4 B7 R9 I8 @0 p% e
        travel to pickaisle.con(A_i), @- L) E/ ]3 C0 p1 U+ U1 w9 h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 y# C( F" L: j8 e) u        else wait for 10 sec) a# W* D9 ?- z8 }& V$ l9 D- G: t2 b
        if A_i=A_leave then send to die
3 n& t/ u+ U$ X5 `$ _        else inc A_i by 1
4 ^' r! b; F3 L    end
% ]0 D; }7 D# H$ P8 d" f) Iend
  T. y9 P' R. }9 n5 K& n- P7 S! `* e" W3 ?% U. j9 h1 o
begin P_pick3 arriving. f! v1 ~0 D8 H/ b& z) c
    set A_i to 21# g" q/ ^, }: Q5 K3 @9 U
    move into Q_induct3+ D3 `9 M1 U# f& z; {# k4 }9 Q  F
    move into pickaisle.induct34 f& ~4 ^& R, g$ D3 ^
    while A_i<=30 do begin- d) l3 i/ l4 l1 v
        travel to pickaisle.con(A_i)
) {8 G; m3 A  r, Y* G# _6 Z# i% E0 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( P5 h$ Z0 d' m1 y; c& H        else wait for 10 sec
+ }& {0 T$ ]2 ]& C. [        if A_i=A_leave then send to die
: g& M8 c! K, c% Y" y        else inc A_i by 1
9 b! S- i7 Y( a: `' H/ N% T    end
1 R5 `3 ]; G. rend

最佳答案

查看完整内容

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是个什么东东?
, Z5 k& r! b( X+ m: ^3 Gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" g' j; J) N& H1 ^0 W
# `$ b4 L: i% C$ kAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 a6 ?6 z: G0 G' P
" g& v* l0 ?% P5 E2 Q1 \另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:: A, P% P# X4 ?2 U
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' C6 r( k) ^+ l  Q- D0 }  ~2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 X9 {% ]& U# n. k
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:- R5 E$ O5 b+ D6 ~
begin P_induction arriving7 @- W. @: T7 h
    clone 1 load to P_pick(A_induct), ~! a3 F5 a3 g8 T
end最大的系
- M% l3 N& V+ L( R4 K3 R9 `. {* P3 Y5 c) C! u3 U) Y6 }
begin P_pick arriving
3 B; M% D2 N4 i3 y. ]    set A_i to procindex * 10 + 1
. z: ], r+ ~' R- x# J% {    move into Q_induct(procindex), F' S8 ]- q) j1 k" i5 g; e7 A0 v
    move into pickaisle.induct(procindex)8 h/ g& P# d4 Q1 x/ |; {
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 \; A) {- s9 W) o5 B. G/ q! H" D0 C* }3 P
    while A_i<=30 do begin) |6 `0 ], ]9 l
        travel to pickaisle.con(A_i)
" {  J# L5 E) K) E# T: z5 j        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 @" i# J4 j8 z) b        else wait for 10 sec2 Q" K* U; c5 |4 y( r% ~
        if A_i=A_leave then send to die: i0 _: c, G9 b  @* a
        else inc A_i by 1
1 _8 S7 Z: L9 B* r' X1 q- C    end
5 u( k; T) ]7 ]! Eend
0 v: ^( C0 ^8 ~( B& E0 V- ~0 @. Q
其中的procindex为整形,代表当前process的序号。
0 W& w: ~* @/ H$ V$ Hstation和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-11 10:10 , Processed in 7.858291 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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